All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javabuildtools.Utils

java.lang.Object
   |
   +----javabuildtools.Utils

public class Utils
extends Object

Variable Index

 o version

Constructor Index

 o Utils()

Method Index

 o blendFilesToVector(Vector, String[])
 o getBaseDirectory(String)
Given a java file name.
 o getFilesFromExtension(String, String[])

Given a directory and an array of extensions...

 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 globalStringReplace(String, String, String)
Given a string...
 o isValidFile(String, String[])

Variables

 o version
 public static final String version

Constructors

 o Utils
 public Utils()

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

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 getFilesFromExtension
 public static String[] getFilesFromExtension(String directory,
                                              String extensions[])

Given a directory and an array of extensions... return an array of compliant files.

The given extensions should be like "java" and not like ".java"

 o globalStringReplace
 public static String globalStringReplace(String original,
                                          String find,
                                          String replacement)
Given a string... replaces all occurences of "find" with "replacement" in "original"

 o blendFilesToVector
 private static Vector blendFilesToVector(Vector v,
                                          String files[])
 o isValidFile
 private static boolean isValidFile(String file,
                                    String extensions[])
 o getFullClassname
 public static String getFullClassname(String javafile) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index