|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.utils.rename.PackageRenamer
public class PackageRenamer
This class performs package renaming. It demonstrates the following: a) Reading the properties file to be a reference for changing the package name from your source code. b) Traverse source root directory for creating a corresponding output directory and finding the java source file(s) to be changing the package name. c) Search and replace the old TopLink package name(s) with new one(s) according to the reference. You will be able to see the logging message at the command line window where the PackageRenamer is running.
Constructor Summary | |
---|---|
PackageRenamer(java.lang.String sourceFolder,
java.lang.String targetFolder,
java.util.Properties properties)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PackageRenamer(java.lang.String sourceFolder, java.lang.String targetFolder, java.util.Properties properties)
Method Detail |
---|
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)
|
EclipseLink 2.0.0, build 'v20091127-r5931' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |