All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class buildtools.JavaUtils

java.lang.Object
   |
   +----buildtools.JavaUtils

public class JavaUtils
extends Object

Variable Index

 o version

Constructor Index

 o JavaUtils()
make the constructor private

Method Index

 o blendFilesToVector(Vector, String[])
Given a Vector.
 o getBaseDirectory(String)
Given a java file name.
 o getClasspath()
Get the current classpath as an array of strings.
 o getFullClassname(String)
 o getPackageName(String)
Given a filename return its package name.
 o getPackageNames(File)

Given a directory.

 o getPackageNames(String)

Given a filename.

 o getTools()
Returns the location of tools.jar
 o requireEntryInClasspath(String)
Given a string entry.

Variables

 o version
 public static final String version

Constructors

 o JavaUtils
 private JavaUtils()
make the constructor private

Methods

 o 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.

 o 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.

 o getClasspath
 public static String[] getClasspath()
Get the current classpath as an array of strings.

 o 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
 o getBaseDirectory
 public static String getBaseDirectory(String filename) throws Exception
Given a java file name. Finds its package name and then returns its base directory.

 o 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.

 o getTools
 public static String getTools()
Returns the location of tools.jar

 o 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
 o getFullClassname
 public static String getFullClassname(String javafile) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index