All Packages Class Hierarchy This Package Previous Next Index
Class buildtools.JavaUtils
java.lang.Object
|
+----buildtools.JavaUtils
- public class JavaUtils
- extends Object
-
version
-
-
JavaUtils()
- make the constructor private
-
blendFilesToVector(Vector, String[])
- Given a Vector.
-
getBaseDirectory(String)
- Given a java file name.
-
getClasspath()
- Get the current classpath as an array of strings.
-
getFullClassname(String)
-
-
getPackageName(String)
- Given a filename return its package name.
-
getPackageNames(File)
-
Given a directory.
-
getPackageNames(String)
-
Given a filename.
-
getTools()
- Returns the location of tools.jar
-
requireEntryInClasspath(String)
- Given a string entry.
version
public static final String version
JavaUtils
private JavaUtils()
- make the constructor private
getPackageNames
public static String[] getPackageNames(String javafilename) throws Exception
-
Given a filename. Finds the root folder, and then determines what java
packages exists throughout the hierarchy.
A package is identified by determining files with a .java file in them
and if they have one, makes sure its "package" reference is correct.
getPackageNames
public static String[] getPackageNames(File directory) throws Exception
-
Given a directory. Finds the root folder, and then determines what java
packages exists throughout the hierarchy.
A package is identified by determining files with a .java file in them
and if they have one, makes sure its "package" reference is correct.
getClasspath
public static String[] getClasspath()
- Get the current classpath as an array of strings.
getPackageName
public static String getPackageName(String fileName) throws Exception
- Given a filename return its package name.
This is used when compiling a package. Basically it looks for the first
instance of "package" in the file and returns this. The provided file must
be a .java file.
- Returns:
- String null if no package or the package name
getBaseDirectory
public static String getBaseDirectory(String filename) throws Exception
- Given a java file name. Finds its package name and then returns its base
directory.
blendFilesToVector
private static Vector blendFilesToVector(Vector v,
String files[])
- Given a Vector. Make sure that it has all the entries in the string array
but do not add duplicate entries.
getTools
public static String getTools()
- Returns the location of tools.jar
requireEntryInClasspath
public static String requireEntryInClasspath(String entry)
- Given a string entry. Make sure it is in the classpath. If it isn't then
add it.
- Returns:
- String The updated classpath
getFullClassname
public static String getFullClassname(String javafile) throws Exception
All Packages Class Hierarchy This Package Previous Next Index