com.zmicer.utils
Class ClassPathUtils

java.lang.Object
  extended by com.zmicer.utils.ClassPathUtils

public class ClassPathUtils
extends Object

Utilities for working with class path. $Author:: zmicer $
$Rev:: 57 $
* $Date:: 2007-08-23 09:16:37 #$


Field Summary
static String CLASS_PATH
          Class path
static String CLASS_PATH_KEY
          CLASS_PATH_KEY
static Pattern JAR_OR_XML_FILES_PATTERN
          Pattern for the xml || jar files tp be found at the classpath
static org.apache.log4j.Logger LOG
          Logger instance.
static String PATH_SEPARATOR
          PATH_SEPARATOR
static String PATH_SEPARATOR_KEY
          PATH_SEPARATOR_KEY
 
Constructor Summary
ClassPathUtils()
           
 
Method Summary
static List<String> getClassPathes()
          Get the classpath and then parse it to retrieve the List of pathes (jars, files etc).
static List<String> getClassPathes(String classPath)
          Get the classpath and then parse it to retrieve the List of pathes (jars, files etc).
static List<String> getDirNames(List<String> pathes, boolean checkFilesOrRE)
          Return the dir names (the check of the specifying patches would be performed to determine if it is dirs but not files)
static List<String> getFileNames(List<String> pathes, boolean checkFilesOrRE)
          Return the file names (the check of the specifying patches would be performed to determine if it is files but not dirs)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Logger instance.


CLASS_PATH_KEY

public static final String CLASS_PATH_KEY
CLASS_PATH_KEY

See Also:
Constant Field Values

PATH_SEPARATOR_KEY

public static final String PATH_SEPARATOR_KEY
PATH_SEPARATOR_KEY

See Also:
Constant Field Values

CLASS_PATH

public static final String CLASS_PATH
Class path


PATH_SEPARATOR

public static final String PATH_SEPARATOR
PATH_SEPARATOR


JAR_OR_XML_FILES_PATTERN

public static final Pattern JAR_OR_XML_FILES_PATTERN
Pattern for the xml || jar files tp be found at the classpath

Constructor Detail

ClassPathUtils

public ClassPathUtils()
Method Detail

getClassPathes

public static List<String> getClassPathes()
Get the classpath and then parse it to retrieve the List of pathes (jars, files etc).

Returns:
the List - pathes

getClassPathes

public static List<String> getClassPathes(String classPath)
Get the classpath and then parse it to retrieve the List of pathes (jars, files etc).

Parameters:
classPath - class path
Returns:
the List - pathes

getFileNames

public static List<String> getFileNames(List<String> pathes,
                                        boolean checkFilesOrRE)
Return the file names (the check of the specifying patches would be performed to determine if it is files but not dirs)

Parameters:
pathes - The List of any pathes. Can not be null (otherwise IllegalArgumentException would appear).
checkFilesOrRE - says what should be used for the checking if the path represents file or dir - File object and approrpiate stuff of REUtils. If it is true the checking using File would be performed, otherwise - using REUtils
Returns:
the List of File Pathes, could be empty if there is not files at the classpath

getDirNames

public static List<String> getDirNames(List<String> pathes,
                                       boolean checkFilesOrRE)
Return the dir names (the check of the specifying patches would be performed to determine if it is dirs but not files)

Parameters:
pathes - The List of any pathes. Can not be null (otherwise IllegalArgumentException would appear).
checkFilesOrRE - says what should be used for the checking if the path represents file or dir - File object and approrpiate stuff of REUtils. If it is true the checking using File would be performed, otherwise - using REUtils. This parammeter was introduced to allow writing good tests for this functionality.
Returns:
the List of Dirs Pathes, could be empty if there is not dirs at the classpath


Copyright © 2007 jzmicer.team. All Rights Reserved.