public class NormalizePath
extends java.lang.Object
At first revision, only the specified subtree is scanned and for any subdirectory found its name is converted to lowercase. If the rename operation is not possible because there is another directory named with different casing (the lowercase), all content of the directory will be moved to the new location and the mixed case directory will be deleted (moved/backed up).
Usage sample (in build.xml
):
<target name="normalize.paths"> <java classname="com.goldencode.util.NormalizePath"> <classpath path="p2j/build/lib/p2j.jar"/> <arg value="${destination.package}/test" /> </java> </target>
Constructor and Description |
---|
NormalizePath() |
Modifier and Type | Method and Description |
---|---|
private static void |
convertToLowercase(java.lang.String root)
Recursive method that scans a subtree and applies the normalization to the root and all its
children.
|
static void |
main(java.lang.String[] args)
The utility entry point.
|
private static void |
moveTo(java.io.File aPath,
java.io.File dest)
Moves a file/directory to another location.
|
public static void main(java.lang.String[] args)
#convertToLowercase()
to
recursively normalize the whole directory tree.args
- The program parameter list. Must contain a single file path, the root target to be
processed.private static void convertToLowercase(java.lang.String root)
root
- The root of the (sub-)tree to be processed.private static void moveTo(java.io.File aPath, java.io.File dest)
aPath
- The target file to be moved.dest
- The new location where the target should be moved.