org.apache.maven.shared.jarsigner
Class JarSignerUtil

java.lang.Object
  extended by org.apache.maven.shared.jarsigner.JarSignerUtil

public class JarSignerUtil
extends Object

Useful methods.

Since:
1.0
Version:
$Id: JarSignerUtil.java 1195937 2011-11-01 11:38:37Z olamy $
Author:
tchemit

Method Summary
static boolean isZipFile(File file)
          Checks whether the specified file is a JAR file.
static void unsignArchive(File jarFile)
          Removes any existing signatures from the specified JAR file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isZipFile

public static boolean isZipFile(File file)
Checks whether the specified file is a JAR file. For our purposes, a ZIP file is a ZIP stream with at least one entry.

Parameters:
file - The file to check, must not be null.
Returns:
true if the file looks like a ZIP file, false otherwise.

unsignArchive

public static void unsignArchive(File jarFile)
                          throws IOException
Removes any existing signatures from the specified JAR file. We will stream from the input JAR directly to the output JAR to retain as much metadata from the original JAR as possible.

Parameters:
jarFile - The JAR file to unsign, must not be null.
Throws:
IOException


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.