How can you get the size of a file in an archive using TrueZip?

后端 未结 1 430
盖世英雄少女心
盖世英雄少女心 2021-01-28 02:10

As per the TrueZip docs, it appears that the length() method returns 0 or -1. I am updating a WAR archive and I would like to only update files whose lengths have c

1条回答
  •  抹茶落季
    2021-01-28 02:44

    First, call the method TFile.umount() to commit any changes.

    Then use the following method to obtain a TFile which does not detect the archive file and call its length() method:

    private static TFile newNonArchiveFile(TFile file) {
        return new TFile(file.getParentFile(), file.getName(), TArchiveDetector.NULL);
    }
    

    0 讨论(0)
提交回复
热议问题