Changeset 13320
- Timestamp:
- 06/10/11 10:12:02 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/zip.java
r13307 r13320 85 85 } 86 86 File file = new File(namestring); 87 87 makeEntry(out, file); 88 88 list = list.cdr(); 89 89 } … … 145 145 continue; 146 146 } 147 147 makeEntry(out, file, directory + file.getName()); 148 148 list = list.cdr(); 149 149 } … … 159 159 160 160 private void makeEntry(ZipOutputStream zip, File file) 161 161 throws FileNotFoundException, IOException 162 162 { 163 163 makeEntry(zip, file, file.getName()); 164 164 } 165 165 166 166 private void makeEntry(ZipOutputStream zip, File file, String name) 167 167 throws FileNotFoundException, IOException 168 168 { 169 169 byte[] buffer = new byte[4096]; 170 171 172 173 174 175 176 177 178 179 180 181 170 long lastModified = file.lastModified(); 171 FileInputStream in = new FileInputStream(file); 172 ZipEntry entry = new ZipEntry(name); 173 if (lastModified > 0) { 174 entry.setTime(lastModified); 175 } 176 zip.putNextEntry(entry); 177 int n; 178 while ((n = in.read(buffer)) > 0) 179 zip.write(buffer, 0, n); 180 zip.closeEntry(); 181 in.close(); 182 182 } 183 183 184 184 }
Note: See TracChangeset
for help on using the changeset viewer.