/** * Forces the fixed timestamp for directories to make sure * classes.jar always get a consistent checksum. */ protected void zipDir(Resource dir, ZipOutputStream zOut, String vPath, int mode, ZipExtraField[] extra) throws IOException { // use wrappedZOut instead of zOut super.zipDir(dir,wrappedZOut,vPath,mode,extra); } };
/** * Add a directory to the zip stream. * @param dir the directory to add to the archive * @param zOut the stream to write to * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. * @throws IOException on error * @since Ant 1.5.2 */ protected void zipDir(final File dir, final ZipOutputStream zOut, final String vPath, final int mode) throws IOException { zipDir(dir, zOut, vPath, mode, null); }
/** * Add a directory to the zip stream. * @param dir the directory to add to the archive * @param zOut the stream to write to * @param vPath the name this entry shall have in the archive * @param mode the Unix permissions to set. * @param extra ZipExtraFields to add * @throws IOException on error * @since Ant 1.6.3 */ protected void zipDir(final File dir, final ZipOutputStream zOut, final String vPath, final int mode, final ZipExtraField[] extra) throws IOException { zipDir(dir == null ? null : new FileResource(dir), zOut, vPath, mode, extra); }
f = new File(dir); zipDir(f, zOut, prefix + dir, dirMode);
/** * Add a directory entry to the archive using a specified * Unix-mode and the default mode for its parent directories (if * necessary). */ private void addDirectoryResource(final Resource r, String name, final String prefix, final File base, final ZipOutputStream zOut, final int defaultDirMode, final int thisDirMode) throws IOException { if (!name.endsWith("/")) { name += "/"; } final int nextToLastSlash = name.lastIndexOf('/', name.length() - 2); if (nextToLastSlash != -1) { addParentDirs(base, name.substring(0, nextToLastSlash + 1), zOut, prefix, defaultDirMode); } zipDir(r, zOut, prefix + name, thisDirMode, r instanceof ZipResource ? ((ZipResource) r).getExtraFields() : null); }
/** * Forces the fixed timestamp for directories to make sure * classes.jar always get a consistent checksum. */ protected void zipDir(Resource dir, ZipOutputStream zOut, String vPath, int mode, ZipExtraField[] extra) throws IOException { // use wrappedZOut instead of zOut super.zipDir(dir,wrappedZOut,vPath,mode,extra); } };