Java Zip ?? ??????????? ?????
Contents
[
Hide
Show
]Aspose.zip API ???????? ???????? ?? ?????????????? ?????, ?? ?????????? ??? ??????? ????????? ??????. ?? ?????? ??????? ?????? ? ?????????, ? ????? ?????????? ??????????? ??????.
????????? ????????
????? ???????? ?????????
1????????? (fileOutputStream Zipfile = ????? FileOutputStream (DataDir + "CompressDirectory_out.zip")) {
2 ????????? (????? ????? = ????? ????? ()) {
3 FILE CORPUS = ????? ???? (DataDir + "Canterburycorpus");
4 ?????.createEntries (??????);
5 Archive.save (Zipfile);
6 }
7} ???? (IOException ex) {
8 System.out.println (ex);
9}????????? ?????? ?????????? ????????
1????????? (fileInputStream Zipfile = ????? FileInputStream (DataDir + "CompressDirectory_out.zip")) {
2 ????????? (????? ????? = ????? ????? (Zipfile)) {
3 archive.extracttodirectory (DataDir + "Decompressfolder_out");
4 }
5} ???? (IOException ex) {
6 System.out.println (ex);
7}????????? ?????? ?? ??????? ??????????
1????????? (fileOutputStream Zipfile = ????? FileOutputStream (DataDir + "CompressFilesByFileInfo_out.zip")) {
2 ???? fi1 = ????? ???? (DataDir + "alice29.txt");
3 ???? fi2 = ????? ???? (DataDir + "fields.c");
4 ????????? (????? ????? = ????? ????? ()) {
5 Archive.CreateEntry ("alice29.txt", fi1);
6 Archive.createEntry ("fields.c", fi2);
7 ArchivesaveOptions Options = ???? ?????????????? ();
8 ?????.setEncoding (StandardCharsets.us_ascii);
9 Archive.save (Zipfile, ????????);
10 }
11} ???? (IOException ex) {
12 System.out.println (ex);
13}???????? ?????? ? ??????? ???????? ?????
1????????? (fileInputStream Zipfile = ????? FileInputStream (DataDir + "\\ arthy_password.zip") {
2 ????????? (????? ????? = ????? ????? (Zipfile)) {
3 archive.getentries (). get (0) .extract (dataDir + "alice29_extracted_pass_out.txt", "first_pass");
4 archive.getentries (). get (1) .extract (dataDir + "asyoulik_extracted_pass_out.txt", "second_pass");
5 }
6} ???? (IOException ex) {
7 System.out.println (ex);
8}