gov.nih.nci.cagrid.introduce.extension.utils
Class ExtensionUtilities

java.lang.Object
  extended by gov.nih.nci.cagrid.introduce.extension.utils.ExtensionUtilities

public class ExtensionUtilities
extends java.lang.Object

ExtensionUtilities Some generic utilities to make extensions easier

Version:
$Id: ExtensionUtilities.java,v 1.15 2007/11/06 15:53:43 hastings Exp $
Author:
David W. Ervin

Field Summary
static java.lang.String CLASSPATHENTRY_ELEMENT
           
 
Constructor Summary
ExtensionUtilities()
           
 
Method Summary
static java.io.File[] getLibrariesFromEclipseClasspath(java.io.File classpathFile)
          Gets the libraries from an eclipse .classpath file
static void removeLibrariesFromClasspath(java.io.File classpathFile, java.io.File[] removeLibs)
          Removes library entries from an Eclipse .classpath file Libraries to be removed may be fully qualified paths, and will first be made relative to the .classpath file before removal is attempted.
static void resyncWithLibDir(java.io.File classpathFile)
          Resynchronizes a classpath file's entries with the contents of the lib dir.
static void syncEclipseClasspath(java.io.File classpathFile, java.io.File[] additionalLibs)
          Adds libraries to an eclipse .classpath file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATHENTRY_ELEMENT

public static final java.lang.String CLASSPATHENTRY_ELEMENT
See Also:
Constant Field Values
Constructor Detail

ExtensionUtilities

public ExtensionUtilities()
Method Detail

syncEclipseClasspath

public static void syncEclipseClasspath(java.io.File classpathFile,
                                        java.io.File[] additionalLibs)
                                 throws java.lang.Exception
Adds libraries to an eclipse .classpath file

Parameters:
classpathFile - The .classpath file
additionalLibs - The libraries (jars) to add to the .classpath. The jars will be added with paths relative to the .classpath file's location
Throws:
java.lang.Exception

getLibrariesFromEclipseClasspath

public static java.io.File[] getLibrariesFromEclipseClasspath(java.io.File classpathFile)
                                                       throws java.lang.Exception
Gets the libraries from an eclipse .classpath file

Parameters:
classpathFile -
Returns:
An array of Files for each library in the classpath
Throws:
java.lang.Exception

removeLibrariesFromClasspath

public static void removeLibrariesFromClasspath(java.io.File classpathFile,
                                                java.io.File[] removeLibs)
                                         throws java.lang.Exception
Removes library entries from an Eclipse .classpath file Libraries to be removed may be fully qualified paths, and will first be made relative to the .classpath file before removal is attempted.

Parameters:
classpathFile -
removeLibs -
Throws:
java.lang.Exception

resyncWithLibDir

public static void resyncWithLibDir(java.io.File classpathFile)
                             throws java.lang.Exception
Resynchronizes a classpath file's entries with the contents of the lib dir. This method removes all entries in the classpath which begin with 'lib/' and adds all jar files found recursively in the lib directory which is a sibling to the .classpath file.

Parameters:
classpathFile -
Throws:
java.lang.Exception