- Timestamp:
- 2009-06-03T16:53:24+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/util/UnzipTools.java
r13328 r19736 62 62 dir.mkdirs(); 63 63 64 // Set up input stream 65 InputStream zis = zip_file.getInputStream(zip_entry); 66 BufferedInputStream bzis = new BufferedInputStream(zis); 67 DataInputStream dbzis = new DataInputStream(bzis); 68 69 // Set up output stream 70 FileOutputStream fzos = new FileOutputStream(zip_entry_file); 71 BufferedOutputStream bfzos = new BufferedOutputStream(fzos); 72 73 byte[] buf = new byte[1024]; 74 int len; 75 while ((len = dbzis.read(buf)) >= 0) { 76 bfzos.write(buf,0,len); 64 // Don't need to unzip files called empty which were created during the zipping process 65 // in order to be able to generate empty directories in a zip (see remote.ZipTools) 66 if(!zip_entry_file.getName().equals("empty")) { 67 // Set up input stream 68 InputStream zis = zip_file.getInputStream(zip_entry); 69 BufferedInputStream bzis = new BufferedInputStream(zis); 70 DataInputStream dbzis = new DataInputStream(bzis); 71 72 // Set up output stream 73 FileOutputStream fzos = new FileOutputStream(zip_entry_file); 74 BufferedOutputStream bfzos = new BufferedOutputStream(fzos); 75 76 byte[] buf = new byte[1024]; 77 int len; 78 while ((len = dbzis.read(buf)) >= 0) { 79 bfzos.write(buf,0,len); 80 } 81 82 dbzis.close(); 83 bzis.close(); 84 zis.close(); 85 86 bfzos.close(); 87 fzos.close(); 77 88 } 78 79 dbzis.close();80 bzis.close();81 zis.close();82 83 bfzos.close();84 fzos.close();85 89 } 86 90 }
Note:
See TracChangeset
for help on using the changeset viewer.