내가 (A zip 파일 내가 FTP를 통해 그를 추출하기 위해 애 쓰고 server.so에) 서버에서 zip 파일을 추출하려고 내가이 코드를 사용하고,FTP zip 파일 추출 오류
byte[] buf = new byte[1024];
ZipInputStream zinstream = new ZipInputStream(Home.ftpClient.retrieveFileStream("HO2BR.br.3162675983055490721.zync"));
ZipEntry zentry = zinstream.getNextEntry();
System.out.println("Name of current Zip Entry : " + zentry + "\n");
while (zentry != null) {
String entryName = zentry.getName();
System.out.println("Name of Zip Entry : " + entryName);
FileOutputStream outstream = new FileOutputStream(entryName);
int n;
while ((n = zinstream.read(buf, 0, 1024)) > -1) {
outstream.write(buf, 0, n);
}
System.out.println("Successfully Extracted File Name : " + entryName);
outstream.close();
zinstream.closeEntry();
zentry = zinstream.getNextEntry();
}
zinstream.close();
}
ZipInputStream (Home.ftpClient.retrieveFileStream ("HO2BR.br.3162675983055490721.zync"))); 이 오류는
java.util.zip.ZipException 발생하는 프로그램이 실행되는 동안 입력 스트림 는 FTPClient의 retrieveFileStream에게
할당 잘못된 거리를 너무 거슬러 java.util.zip에서. InflaterInputStream.read (InflaterInputStream.java:164)
이 예외는 어떻게 해결할 수 있습니까?
안녕하세요, 서버에서 압축 파일을 추출 할 수 있습니다. 파일을 다운로드하지 않고 서버에 압축을 풀어야합니다. –