
Classes | |
| class | JarFileNameFilter |
Public Member Functions | |
| JarFileHelper (String name, String[] folders) throws Exception | |
| JarFileHelper (File file) throws Exception | |
| int | getPackages (Collection< String > javaPackages) throws IOException |
| void | getClasses (Collection< String > javaClasses) throws IOException |
| Collection< String > | getMatchingClasses (String name) throws IOException |
| String | getFilePathName () |
| String | getName () |
Private Member Functions | |
| void | addJavaPackage (String str, Collection< String > vector) |
| void | addJavaClass (String str, Collection< String > vector) |
Private Attributes | |
| final String | name |
| final File | file |
Static Private Attributes | |
| static final Logger | logger = Logger.getAnonymousLogger() |
Objects from this class allow to browse the content of a jar file focusing on classes and packages.
There are 2 ways to use JarFileHelper objects:
lc.jar: in this case the jar file is retrieved by following ACS rules i.e. ../lib, INROOT/lib... $INTROOT/lib/lc.jar Given the name of a jar file, JarFile get the right jar file from the file system looking the folder as ACS rules. The content of thSe jar file is then examined to get the list of the java classes and packages it contains as well as any other info needed.
Note: this class is intended to work only with ACS distributed jar files.
| alma::acs::eclipse::utils::jar::JarFileHelper::JarFileHelper | ( | String | name, | |
| String[] | folders | |||
| ) | throws Exception [inline] |
Constructor.
| name | The name of the ACS jar file (like lc.jar) | |
| folders | The folders to look for the jar files |
| Exception |
References file, alma::acs::makesupport::AcsFileFinder::getFiles(), logger, and name.
| alma::acs::eclipse::utils::jar::JarFileHelper::JarFileHelper | ( | File | file | ) | throws Exception [inline] |
| void alma::acs::eclipse::utils::jar::JarFileHelper::addJavaClass | ( | String | str, | |
| Collection< String > | vector | |||
| ) | [inline, private] |
Add a java class to the vector if it is not already there.
The class name is calculated by checking the passed string.
| str | The entry of the jar that could point to a java class | |
| vector | The vector of classes where the package must be added |
Referenced by getClasses().
| void alma::acs::eclipse::utils::jar::JarFileHelper::addJavaPackage | ( | String | str, | |
| Collection< String > | vector | |||
| ) | [inline, private] |
Add a java package to the vector if it is not already there.
The package name is calculated by checking the passed string
| str | The entry of the jar that could point to a jar | |
| vector | The vector of packages where the package must be added |
Referenced by getPackages().
| void alma::acs::eclipse::utils::jar::JarFileHelper::getClasses | ( | Collection< String > | javaClasses | ) | throws IOException [inline] |
Flush the java classes contained in this jar file into the passed vector.
References addJavaClass(), and file.
Referenced by getMatchingClasses().
| String alma::acs::eclipse::utils::jar::JarFileHelper::getFilePathName | ( | ) | [inline] |
References file.
| Collection<String> alma::acs::eclipse::utils::jar::JarFileHelper::getMatchingClasses | ( | String | name | ) | throws IOException [inline] |
Check if a class with the given name is in the jar. The match is not done for the whole name of the class but from its initial part. For example if the parameter is Logging and the jar is lc.jar then the returned array contains LoggingClient and LoggingClientText
| name | The beginning of the name of the class |
null if no class name in the jar matches with the parameter | IOException | In case of error reading the jar file |
References getClasses(), and name.
Referenced by alma::acs::eclipse::utils::jar::JarFolder::getJarsContainingClass().
| String alma::acs::eclipse::utils::jar::JarFileHelper::getName | ( | ) | [inline] |
References name.
Referenced by alma::acs::eclipse::utils::jar::JarFolder::getJarsContainingClass().
| int alma::acs::eclipse::utils::jar::JarFileHelper::getPackages | ( | Collection< String > | javaPackages | ) | throws IOException [inline] |
Flush the java packages contained in this jar file into the passed vector.
| IOException | In case of error reading the jar file |
References addJavaPackage(), and file.
final File alma::acs::eclipse::utils::jar::JarFileHelper::file [private] |
The jar file.
This file is obtained by scanning ACS folder like INTROOT, ACSROOT and so on
Referenced by getClasses(), getFilePathName(), getPackages(), and JarFileHelper().
final Logger alma::acs::eclipse::utils::jar::JarFileHelper::logger = Logger.getAnonymousLogger() [static, private] |
The logger
Referenced by JarFileHelper().
final String alma::acs::eclipse::utils::jar::JarFileHelper::name [private] |
The name of the jar file like for example lc.jar
Referenced by getMatchingClasses(), getName(), and JarFileHelper().
1.6.2