[英]How can you get the size of a file in an archive using TrueZip?
根據TrueZip文檔,似乎length()
方法返回0或-1。 我正在更新WAR存檔,我只想更新其長度已更改的文件。 如何做到這一點?
提前致謝,
馬丁
首先,調用方法TFile.umount()
提交所有更改。
然后使用以下方法獲取未檢測到存檔文件的TFile並調用其length()方法:
private static TFile newNonArchiveFile(TFile file) {
return new TFile(file.getParentFile(), file.getName(), TArchiveDetector.NULL);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.