/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: FilesDigester.java,v 1.2 2008/09/04 22:26:12 kevinserwin Exp $
*/
protected char wildCard;
protected boolean recursive;
/**
* FileDigester constructor
*
* @param includePattern A list of patterns of file name should be included.
* @param excludePattern A list of patterns of file name should be excluded.
* @param wildCard The wildcard character which is used in the pattern.
*/
this.includePattern = includePattern;
this.excludePattern = excludePattern;
}
/**
* This function calculate the hash value of a war file.
*
* This function will calculate the manifest according to the decompressed
* files contained in the war file.
*
* @param hashAlg The algorithm to be used for calculating the hash.
* @param digestResult The Properties to store the results.
* @param wfile The war file to be processed.
* @param intoJar The flat to indicate whether to handle jar file by using
* its decompressed contents.
*/
byte[] digestCode = null;
try {
while (wEnum.hasMoreElements()) {
if (!we.isDirectory()) {
} else{
}
}
}
} catch (IOException ex) {
} finally {
try {
} catch (IOException ignored) {
}
}
}
}
/**
* This function calculate the hash value of a jar file.
*
* This function handles the jar file as a concatenation of the decompressed
* files it contains.
*
* @param hashAlg The algorithm to be used for calculating the hash.
* @param in The InputStream of the jar file to be processed.
*/
try {
if (!je.isDirectory()) {
}
jin.closeEntry();
}
} catch (IOException ex) {
} catch (NoSuchAlgorithmException ex) {
} finally {
try {
} catch (IOException ignored) {
}
}
}
return null;
}
/**
* This function calculate the hash value of a file.
*
* @param hashAlg The algorithm to be used for calculating the hash.
* @param file The file to be processed.
* @param digestResult The Properties to store the results.
* @param ignoredPath The parent's path to ignore when printing the
* manifest entries.
* @param intoJar The flag to indicate whether to specially handle
* jar file.
* @param intoWar The flag to indicate whether to specially handle
* war file.
*/
if (file.isDirectory()) {
if (recursive) {
if (includePattern != null) {
} else{
}
if (tempFiles[i].isDirectory()) {
} else{
if (excludePattern != null) {
excludePattern, wildCard)) {
}
} else{
}
}
}
}
} else{
try {
intoJar);
} catch (IOException ex) {
}
} else{
byte[] digestedbyte = null;
try {
} catch (IOException ex) {
} finally {
try {
} catch (IOException ignored) {
}
}
}
} else{
try {
} catch (IOException ex) {
} finally {
try {
} catch (IOException ignored) {
}
}
}
}
}
}
}
}
}
/**
* This function append the result to the StringBuffer.
*
* @param result The properties to store the results.
* @param path The path of the entry.
* @param digestedbyte The byte array which contains the digested result.
*/
byte[] digestedbyte){
}
}