Package org.codehaus.cargo.util
Class JarUtils
- java.lang.Object
-
- org.codehaus.cargo.util.JarUtils
-
public final class JarUtils extends Object
Some utility classes for manipulating JAR files.
-
-
Constructor Summary
Constructors Constructor Description JarUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsClass(String jarFile, String classToBeFound)
Search through JAR file to check if it contains specified class.protected void
createJarFromDirectory(File root, File directory, JarOutputStream jarStream)
Create a jar file from a particular directory.File
createJarFromDirectory(String directory, File outputJar)
Create a JAR file from a directory, recursing through children.
-
-
-
Method Detail
-
createJarFromDirectory
protected void createJarFromDirectory(File root, File directory, JarOutputStream jarStream) throws IOException
Create a jar file from a particular directory.- Parameters:
root
- in the root directorydirectory
- in the directory we are addingjarStream
- the jar stream to be added to- Throws:
IOException
- on IOException
-
createJarFromDirectory
public File createJarFromDirectory(String directory, File outputJar) throws IOException
Create a JAR file from a directory, recursing through children.- Parameters:
directory
- in directory sourceoutputJar
- in file to output the jar data to- Returns:
- out File that was generated
- Throws:
IOException
- when there is an I/O exception
-
containsClass
public boolean containsClass(String jarFile, String classToBeFound) throws IOException
Search through JAR file to check if it contains specified class.- Parameters:
jarFile
- JAR file to be searched.classToBeFound
- Class which we look for (including package).- Returns:
- True if JAR file contains specified class.
- Throws:
IOException
- when there is an I/O exception
-
-