/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This is OBSOLETE. DO NOT USE THIS. Use java.util.jar.Manifest
* instead. It has to stay here because some apps (namely HJ and HJV)
* call directly into it.
*
* @author David Brown
* @author Benjamin Renaud
*/
public class Manifest {
/* list of headers that all pertain to a particular
* file in the archive
*/
/* a hashtable of entries, for fast lookup */
static final boolean debug = false;
if (debug)
}
public Manifest() {}
this(new ByteArrayInputStream(bytes), false);
}
this(is, true);
}
/**
* Parse a manifest from a stream, optionally computing hashes
* for the files.
*/
if (!is.markSupported()) {
}
/* do not rely on available() here! */
while (true) {
break;
}
if (compute) {
doHashes(m);
}
addEntry(m);
}
}
/* recursively generate manifests from directory tree */
}
}
}
}
}
}
return;
} else {
}
if (file.isDirectory()) {
} else {
}
}
}
/**
* File names are represented internally using "/";
* they are converted to the local format for anything else
*/
}
return name;
}
}
}
// If unnamed or is a directory return immediately
return;
}
/* compute hashes, write over any other "Hash-Algorithms" (?) */
try {
int len;
}
} catch (NoSuchAlgorithmException e) {
" not available.");
} finally {
}
}
}
/* Add a manifest file at current position in a stream
*/
if (os instanceof PrintStream) {
} else {
}
/* the first header in the file should be the global one.
* It should say "Manifest-Version: x.x"; if not add it
*/
/* Assume this is a user-defined manifest. If it has a Name: <..>
* field, then it is not global, in which case we just add our own
* global Manifest-version: <version>
* If the first MessageHeader has no Name: <..>, we assume it
* is a global header and so prepend Manifest to it.
*/
} else {
}
}
}
}
// remove leading /
}
// case insensitive
return true;
}
return false;
}
}