public class PackageRenamer
extends java.lang.Object
Constructor and Description |
---|
PackageRenamer(java.lang.String sourceFolder,
java.lang.String targetFolder,
java.util.Properties properties) |
Modifier and Type | Method and Description |
---|---|
void |
binaryCopy(java.io.File inFile,
java.io.File outFile)
Do a binary copy of the file byte buffer by byte buffer.
|
java.io.File |
buildAndCheckDestinationFile(java.lang.String aDirString) |
java.io.File |
buildAndCheckExistingDirFile(java.lang.String aDirString) |
static boolean |
directoryIsSubdirectory(java.io.File directory1,
java.io.File directory2)
Return true if directory2 is contained within directory1.
|
java.util.List<java.io.File> |
getIgnoreFiles() |
java.util.List<RenameValue> |
getRenameValues() |
boolean |
isExtensionSupported(java.lang.String extension)
Return true if the PackageRenamer should work on the given file
extension.
|
protected static java.lang.String |
parseFileExtension(java.lang.String fileName)
Returns the extension of the given file.
|
java.lang.String |
renameFile(java.lang.String source) |
void |
run()
This run() method performs, reading the properties file into properties
variable to be a reference for changing package name. creating an
destination-root-direetory. and, calling traverseSourceDirectory()
method.
|
void |
runSearchAndReplacePackageName(java.io.File sourceFile)
This runSearchAndReplacePackageName() reads an pre-rename source file all
into string variable and replacing the old package names with the new
ones according to the properties file.
|
void |
traverseSourceDirectory(java.io.File directory)
This traverseSourceDirectory() traverse source-root-directory, creating
an corresponding output directory, and calling another method for
replacing old TopLink package name.
|
public PackageRenamer(java.lang.String sourceFolder, java.lang.String targetFolder, java.util.Properties properties)
public java.util.List<java.io.File> getIgnoreFiles()
public java.util.List<RenameValue> getRenameValues()
public void binaryCopy(java.io.File inFile, java.io.File outFile) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public java.io.File buildAndCheckDestinationFile(java.lang.String aDirString)
public java.io.File buildAndCheckExistingDirFile(java.lang.String aDirString)
protected static java.lang.String parseFileExtension(java.lang.String fileName)
public static boolean directoryIsSubdirectory(java.io.File directory1, java.io.File directory2)
public boolean isExtensionSupported(java.lang.String extension)
public void run()
public void runSearchAndReplacePackageName(java.io.File sourceFile)
public java.lang.String renameFile(java.lang.String source)
public void traverseSourceDirectory(java.io.File directory)