1
作爲Convert .tar.gz file to .zip using TrueZip?的後續措施,如何使用TrueZip將一個壓縮文件的內容複製到另一個文件中?當我調用:如何使用TrueZip TPath複製文件?
TPath sourceFile = new TPath("c:/foo.zip");
TPath targetFile = new TPath("c:/bar.jar");
Files.copy(sourceFile, targetFile, StandardCopyOption.COPY_ATTRIBUTES);
我得到:
java.io.FileNotFoundException: C:\foo.zip (expected FILE - is DIRECTORY)
at de.schlichtherle.truezip.nio.file.TFileSystemProvider.copy(TFileSystemProvider.java:397)
at de.schlichtherle.truezip.nio.file.TFileSystemProvider.copy(TFileSystemProvider.java:364)
at java.nio.file.Files.copy(Files.java:1219)
的事情是,我知道一個事實,即c:/foo.zip
是現有文件,而不是一個目錄。
- 爲什麼我得到這個錯誤?
- 我該如何將ZIP文件轉換爲使用TPath的JAR文件?
- TPath是否需要像TFile那樣卸載?