6970717273747576777879
void zipFile(final File file, final String name) throws IOException { Copy.copy(source(file), sink(entry(name))); } Source source(File file) { return new FileStore(file); } Sink sink(ZipEntry entry) { return new ZipEntrySink(entry, output); }
104105106107108109110111112113114
for (final ZipEntry entry : input) { if (entry.isDirectory()) continue; final File file = new File(directory, entry.getName()); file.getParentFile().mkdirs(); Copy.copy(new ZipEntrySource(entry, input), new FileStore(file)); } return null; } } // UnzipTask
196197198199200201202203204205206
} public static void copyFile(final File from, final File to) throws IOException { try { Copy.copy(new FileStore(from), new FileStore(to)); } catch (IOException ex) { throw new IOException(String.format("Could not copy '%s' to '%s'.", from, to), ex); } }
697071727374
void zipFile(final File file, final String name) throws IOException { Copy.copy(source(file), sink(entry(name))); } Source source(File file) { return new FileStore(file); }
104105106107108109110111112
for (final ZipEntry entry : input) { if (entry.isDirectory()) continue; final File file = new File(directory, entry.getName()); file.getParentFile().mkdirs(); Copy.copy(new ZipEntrySource(entry, input), new FileStore(file)); } return null; }