????????? ????????? zip Archive
?? ???? ???????, ?? ?? ?????? ????????? ????????? Zip Archive ? ?????? ??????. ?? ?????? ???? ??????? ??????? ?????, ??? ??? ????????? ?? ???????? ????? ??????.
?????
????? ????
????? ?????, ???? ? ??????????? ??? ?????, ???’?????? ? ????????. ????? ??? ????????? ???? ????? - AntineCompressed (
GetEntryCompressed/
setEntryCompressed). ??? ???????????? ????? ????????? ??????, ? ??? ????? ?????????.
?????????? ??????? ??????
???????, ?? ??????, ??? ??? ????? Zip ????????? ????????? ?? ???????. ????? ????, ?? ?????? ????? ??? ?????????, ??????????? ???, ???? ???????? ? ??????? ?????????, ? ???? ?? ??????? ?????? ???????, ???????? ??????. ????????? ????? ??? ??????? ?? ??????, ????????? ???, ?? ?????? ?????.
1????????? (????? ????? = ????? ????? ()) {
2 Archive.createEntries ("D: \\ bigfolder");
3 ??????? EB = ????? ????? ();
4
5 Instant starts = Instant.now();
6
7 eb.setEntryCompressed((sender, args) -> {
8 if (starts.plusSeconds(60).isBefore(Instant.now()))
9 args.setCancel(true);
10 });
11 ArchiveSaveOptions options = new ArchiveSaveOptions();
12 options.setEventsBag(eb);
13 archive.save("output.zip", options);
14}?????????? ????? ??????? ?????
???? ?? ?????? ????????? ????? ????, ?? ?????????? ????? ??? ?????????, ?????????????? ????????? ????????:
1????????? (????? ????? = ????? ????? ()) {
2 Archive.createEntries ("D: \\ bigfolder");
3 ??????? EB = ????? ????? ();
4 eb.setentrycompressed ((??????????, args) -> {
5 System.out.println (args.getentry (). GetName ());
6 if (args.getentry (). getName (). ???????? ("bigfolder \\ last.bin"))))
7 args.setcancel (??????);
8 });
9 ArchivesaveOptions Options = ???? ?????????????? ();
10 ?????.seteventsbag (EB);
11 Archive.save ("output.zip", ?????????);
12}