Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::makesupport::JarSourceExtractor Class Reference

List of all members.

Public Member Functions

 JarSourceExtractor ()
void extractJavaSourcesToFiles (JarFile jarfile, File outDir) throws IOException
void extractJavaSourcesToJar (JarFile jarfile, JarOutputStream jarOut) throws IOException
JarEntry[] getJavaEntries (JarFile jarfile)

Static Public Attributes

final String[] PREFIX_PATHS = new String[] {"src", "test"}

Package Functions

void extract (JarFile jarfile, JarEntry entry, OutputStream out) throws IOException

Private Member Functions

String getClassName (JarEntry javaEntry)

Detailed Description

Author:
hsommer created Sep 16, 2003 4:24:41 PM


Constructor & Destructor Documentation

alma::acs::makesupport::JarSourceExtractor::JarSourceExtractor  )  [inline]
 


Member Function Documentation

void alma::acs::makesupport::JarSourceExtractor::extract JarFile  jarfile,
JarEntry  entry,
OutputStream  out
throws IOException [inline, package]
 

Extracts a file from a JAR file and writes it to an output stream. Does not close the output stream.

Parameters:
jarfile the jarfile from which to extract a file
entry the entry (file) to be extracted from the jar file
out the stream to write the entry to
Exceptions:
IOException if the Jar file can't be read or the out stream can't be written to

void alma::acs::makesupport::JarSourceExtractor::extractJavaSourcesToFiles JarFile  jarfile,
File  outDir
throws IOException [inline]
 

Extracts Java source files from a JAR file and puts them as individual files under a given directory.

Parameters:
jarfile jar file from which Java source will be extracted
outDir root dir under which the extracted java files will be placed
Exceptions:
IOException 

void alma::acs::makesupport::JarSourceExtractor::extractJavaSourcesToJar JarFile  jarfile,
JarOutputStream  jarOut
throws IOException [inline]
 

Extracts Java source files from a JAR file and adds them to another JAR file.

Parameters:
jarfile jar file from which Java source will be extracted
jarOut JAR output stream to which the extracted java files will be written; jarOut is left open by this method, so that the client can either call it again, or call jarOut.close() when it's done. (there are problems with re-opening and adding entries to a Jar file.)
Exceptions:
IOException 

String alma::acs::makesupport::JarSourceExtractor::getClassName JarEntry  javaEntry  )  [inline, private]
 

Gets the Java class name from a JarEntry.

Uses PREFIX_PATHS to remove a leading prefix path that is not part of the Java package.

Parameters:
javaEntry 
Returns:
the class name

JarEntry [] alma::acs::makesupport::JarSourceExtractor::getJavaEntries JarFile  jarfile  )  [inline]
 

Lists all Java source files that are contained inside a given JAR file.

The current implementation only looks for a ".java" file ending, ignoring the contents of such files.

Parameters:
jarfile the JAR file to be searched
Returns:
entries that are Java source files (array != null, possibly empty)


Member Data Documentation

final String [] alma::acs::makesupport::JarSourceExtractor::PREFIX_PATHS = new String[] {"src", "test"} [static]
 

prefix paths inside JAR files which are not considered part of Java package paths


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:54:01 2009 for ACS Java API by doxygen 1.3.8