|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.maven.exceptions.util.FileNameUtils
public final class FileNameUtils
Utilities to work on file names and files.
Method Summary | |
---|---|
static String |
createPackageName(String dirName) Creates the package name for the given directory. |
static String |
createPackageNames(org.apache.commons.logging.Log log, String rootDir, de.smartics.exceptions.report.scan.ScannerFactory scannerFactory) Creates package names from directory files found by the given scanner. |
static boolean |
isArchive(String root) Checks if the given root refers to an archive or not. |
static boolean |
isRootAccessible(String root) Checks if root points to a directory of file that is existing and readable. |
static String |
normalizePath(String path) Returns the normalized path where duplicate slashes are removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isArchive(String root) throws NullPointerException
root
- the root to check.
true
if root refers to an archive file,
false
otherwise.
NullPointerException
- if
root
is
null
.
public static String createPackageNames(org.apache.commons.logging.Log log, String rootDir, de.smartics.exceptions.report.scan.ScannerFactory scannerFactory) throws NullPointerException
log
- the logger to log at debug level. No logging if
log
is
null
.
rootDir
- the root directory to create a scanner on.
scannerFactory
- the factory to create the scanner with the given
rootDir
.
:
) or the empty string if the root directory is not accessible (will be logged at debug level if
log
is not
null
.
NullPointerException
- if the
rootDir
or
scannerFactory
is
null
.
public static String createPackageName(String dirName) throws IllegalArgumentException, NullPointerException
dirName
- the name of the directory that contains classes of a package. It is expected that the directory is relative to the source root directory.
NullPointerException
- if
dirName
is
null
.
IllegalArgumentException
- if the directory is not valid as a package directory or if
dirName
is blank.
public static String normalizePath(String path)
path
- the path to normalize.
public static boolean isRootAccessible(String root) throws NullPointerException
root
points to a directory of file that is existing and readable.
root
- the directory or file name to check.
true
if the directory of file exists,
false
otherwise.
NullPointerException
- if the
root
argument is
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |