alma::acs::eclipse::utils::pluginbuilder::BuildProperties Class Reference

Collaboration diagram for alma::acs::eclipse::utils::pluginbuilder::BuildProperties:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BuildProperties (String folder) throws Exception
String[] getJars () throws Exception

Public Attributes

final Pattern propertyPattern = Pattern.compile("\\s*jars.extra.classpath\\s*=\\s*")
final Pattern jarPattern = Pattern.compile(".*jar")

Static Public Attributes

static final String fileOfProperties = "build.properties"

Private Member Functions

void generateListOfJars (File inF) throws Exception
String getJarNames (String str)
void removeDuplicates (Vector< String > v)

Private Attributes

final Vector< String > classpathEntries = new Vector<String>()

Detailed Description

Read the list of jars from the build.properties.

Author:
acaproni
Since:
ACS-8.0.1

Constructor & Destructor Documentation

alma::acs::eclipse::utils::pluginbuilder::BuildProperties::BuildProperties ( String  folder  )  throws Exception [inline]

Constructor

Parameters:
folder The folder containing the fileOfProperties file.

References classpathEntries, fileOfProperties, and generateListOfJars().


Member Function Documentation

void alma::acs::eclipse::utils::pluginbuilder::BuildProperties::generateListOfJars ( File  inF  )  throws Exception [inline, private]

Read the file and get the jars of the propertyPattern property.

Implementation note:

  1. scan the file until found a string matching propertyPattern
  2. read and concatenate all the jars in the string
  3. repeat the previous step if the line continue in the next line i.e. the line terminates with "\"
  4. clean the string and extract the jar names
Parameters:
inF The file to read the list of jars from

References classpathEntries, propertyPattern, and removeDuplicates().

Referenced by BuildProperties().

String alma::acs::eclipse::utils::pluginbuilder::BuildProperties::getJarNames ( String  str  )  [inline, private]

Get the names of the jars in the passed string String

The names of the jars are intended as written in the fileOfProperties file like for example platform:/plugin/ACS_Utility_Jars/jacorb.jar.

A line can contain a comma separated list of jars

Parameters:
str The string containing a jar
Returns:
The names of the jars or null if the string does not contain a jar

References propertyPattern.

String [] alma::acs::eclipse::utils::pluginbuilder::BuildProperties::getJars (  )  throws Exception [inline]

Return the name of the jars in the build.properties like for example acscommon.jar

Returns:
The name of the jars

References classpathEntries, and fileOfProperties.

void alma::acs::eclipse::utils::pluginbuilder::BuildProperties::removeDuplicates ( Vector< String >  v  )  [inline, private]

Remove duplicated entries from the vector.

Given that the order of the entries is important, in case the same entry appears more then once, the last one will be removed.

Parameters:
v 

Referenced by generateListOfJars().


Member Data Documentation

final Vector<String> alma::acs::eclipse::utils::pluginbuilder::BuildProperties::classpathEntries = new Vector<String>() [private]

The list of required jars read from the file.

The vector preserve the order i.e. item at position 0 contains the first read jar and so on.

The name of a jar is intended as written in the fileOfProperties file like for example platform:/plugin/ACS_Utility_Jars/jacorb.jar.

Note: the order of the entries in the file is important and therefore a Set can't be used.

Referenced by BuildProperties(), generateListOfJars(), and getJars().

The name of the file of eclipse properties to read

Referenced by BuildProperties(), and getJars().

The regular expression with the name of a jar

final Pattern alma::acs::eclipse::utils::pluginbuilder::BuildProperties::propertyPattern = Pattern.compile("\\s*jars.extra.classpath\\s*=\\s*")

The regular expression with the name of the property in the fileOfProperties listing the required jars.

Referenced by generateListOfJars(), and getJarNames().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2