Code example for JarEntry

Methods: getNamegetSizegetTimeisDirectory

0
	} 
 
	private static void unpackEntry(final String destDir,
			final String srcFileName, final JarFile flexWarFile,
			final JarEntry entry, final int override) throws IOException {
		final File destFile = new File(destDir + "/" + entry.getName()); //$NON-NLS-1$
		File parent = destFile.getParentFile();
		if (parent != null && !parent.exists()) {
			parent.mkdirs();
		} 
		if (entry.isDirectory()) {
			destFile.mkdirs();
			return; 
		} 
 
		if (destFile.exists()
				&& (override == OVERRIDE_NEVER || override == OVERRIDE_UPDATE
						&& destFile.lastModified() >= entry.getTime())) {
			return; 
		} 
 
		InputStream is = null;
		FileOutputStream os = null;
		try { 
			os = new FileOutputStream(destFile);
			is = flexWarFile.getInputStream(entry);
			final ReadableByteChannel inChannel = Channels.newChannel(is);
			final WritableByteChannel outChannel = Channels.newChannel(os);
			final ByteBuffer buffer = ByteBuffer
					.allocate((int) entry.getSize());
			inChannel.read(buffer);
			buffer.position(0);
			outChannel.write(buffer);
			os.flush();
		} finally { 
			Util.close(is);
			Util.close(os);
			destFile.setLastModified(entry.getTime());
		} 
	} 
 
	public static void copyFiles(final List<File> srcFiles, final File destDir,
			final int overrideOption, final String[] exceptFiles) throws FileNotFoundException, IOException {
Connect your IDE to all the code out there  Get Codota for Java