Package org.codehaus.cargo.module
Interface JarArchive
-
- All Known Subinterfaces:
EarArchive,EjbArchive,JarArchiveUpdateable,WarArchive
- All Known Implementing Classes:
DefaultEarArchive,DefaultEjbArchive,DefaultJarArchive,DefaultWarArchive,MergedWarArchive
public interface JarArchiveProvide convenient methods to read information from a Jar archive.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsClass(String className)Returns whether a class of the specified name is contained in the archive.voidexpandToPath(String path)Expand the archive to the specified directory.StringfindResource(String name)Returns the full path of a named resource in the archive.InputStreamgetResource(String path)Returns a resource from the archive as input stream.List<String>getResources(String path)Returns the list of resources in the specified directory in the archive.
-
-
-
Method Detail
-
containsClass
boolean containsClass(String className) throws IOException
Returns whether a class of the specified name is contained in the archive.- Parameters:
className- The name of the class to search for- Returns:
- Whether the class was found
- Throws:
IOException- If an I/O error occurred reading the archive
-
findResource
String findResource(String name) throws IOException
Returns the full path of a named resource in the archive.- Parameters:
name- The name of the resource- Returns:
- The full path to the resource inside the archive
- Throws:
IOException- If an I/O error occurred reading the archive
-
getResource
InputStream getResource(String path) throws IOException
Returns a resource from the archive as input stream.- Parameters:
path- The path to the resource in the archive- Returns:
- An input stream containing the specified resource, or
nullif the resource was not found in the JAR - Throws:
IOException- If an I/O error occurs
-
getResources
List<String> getResources(String path) throws IOException
Returns the list of resources in the specified directory in the archive.- Parameters:
path- The directory- Returns:
- The list of resources
- Throws:
IOException- If an I/O error occurs
-
expandToPath
void expandToPath(String path) throws IOException
Expand the archive to the specified directory.- Parameters:
path- The path to expand to- Throws:
IOException- If an I/O error occurs
-
-