blob: c73d064d1424f041d8a4b816410215f65501bf6a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Fri Oct 16 14:57:53 EDT 2009 -->
<TITLE>
PackageRenamer (EclipseLink 1.2.0, build 'v20091016-r5565' API Reference)
</TITLE>
<META NAME="date" CONTENT="2009-10-16">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="PackageRenamer (EclipseLink 1.2.0, build 'v20091016-r5565' API Reference)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
EclipseLink 1.2.0, build 'v20091016-r5565' API Reference</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/eclipse/persistence/tools/PackageRenamer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="PackageRenamer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.eclipse.persistence.tools</FONT>
<BR>
Class PackageRenamer</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.eclipse.persistence.tools.PackageRenamer</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>PackageRenamer</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
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.
<P>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools">PackageRenamer.PackageRenamerException</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#SYSTEM_OUT">SYSTEM_OUT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer()">PackageRenamer</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The constructor of a PackageRenamer class.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer(java.lang.String)">PackageRenamer</A></B>(java.lang.String&nbsp;propertiesFileName)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer(java.lang.String[])">PackageRenamer</A></B>(java.lang.String[]&nbsp;args)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#bannerText()">bannerText</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#binaryCopy(java.io.File, java.io.File)">binaryCopy</A></B>(java.io.File&nbsp;inFile,
java.io.File&nbsp;outFile)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do a binary copy of the file byte buffer by byte buffer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#bufferContainsNullChar(byte[], int)">bufferContainsNullChar</A></B>(byte[]&nbsp;buffer,
int&nbsp;bufferLength)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckDestinationFile(java.lang.String)">buildAndCheckDestinationFile</A></B>(java.lang.String&nbsp;aDirString)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTERNAL</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckExistingDirFile(java.lang.String)">buildAndCheckExistingDirFile</A></B>(java.lang.String&nbsp;aDirString)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.PrintWriter</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckLogWriter(java.lang.String)">buildAndCheckLogWriter</A></B>(java.lang.String&nbsp;logFileString)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#cleanup()">cleanup</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#createDestinationDirectory(java.io.File)">createDestinationDirectory</A></B>(java.io.File&nbsp;aDirectory)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method creates an output directory for post-rename file(s).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#directoryIsSubdirectory(java.io.File, java.io.File)">directoryIsSubdirectory</A></B>(java.io.File&nbsp;directory1,
java.io.File&nbsp;directory2)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if directory2 is contained within directory1.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#existingDirectoryFromPrompt()">existingDirectoryFromPrompt</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#getDefaultPropertiesFileName()">getDefaultPropertiesFileName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.BufferedReader</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#getReader()">getReader</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#isExtensionSupported(java.lang.String)">isExtensionSupported</A></B>(java.lang.String&nbsp;extension)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the PackageRenamer should work on the given file extension.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#logln(java.lang.String)">logln</A></B>(java.lang.String&nbsp;str)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main method to run the PackageRenamer</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#parseFileExtension(java.io.File)">parseFileExtension</A></B>(java.io.File&nbsp;aFile)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the extension of the given file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.io.File</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#promptForDestinationDirectory()">promptForDestinationDirectory</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INTERNAL
Prompt from System.in for an empty or non-existent directory to use as the destination directory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Properties</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#readChangesFile(java.lang.String)">readChangesFile</A></B>(java.lang.String&nbsp;filename)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This readChangesFile() method reads the given properties file to be a reference
for renaming TopLink package name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#replace(java.lang.String, java.lang.String, java.lang.String)">replace</A></B>(java.lang.String&nbsp;str,
java.lang.String&nbsp;oldChars,
java.lang.String&nbsp;newChars)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do a search and replace in a string.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#returnNewFileNameIfRequired(java.lang.String)">returnNewFileNameIfRequired</A></B>(java.lang.String&nbsp;aSourceFileNameWithoutRoot)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#run()">run</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This run() method performs,
reading the properties file into properties variable to be a reference for changing package name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#runSearchAndReplacePackageName(java.io.File)">runSearchAndReplacePackageName</A></B>(java.io.File&nbsp;sourceFile)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.io.PrintWriter</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#streamForNonExistentFilePrompt()">streamForNonExistentFilePrompt</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#traverseSourceDirectory(java.io.File)">traverseSourceDirectory</A></B>(java.io.File&nbsp;aDirectoryString)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This traverseSourceDirectory() traverse source-root-directory, creating an corresponding output directory,
and calling another method for replacing old TopLink package name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#usage()">usage</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SYSTEM_OUT"><!-- --></A><H3>
SYSTEM_OUT</H3>
<PRE>
protected static final java.lang.String <B>SYSTEM_OUT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.persistence.tools.PackageRenamer.SYSTEM_OUT">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="PackageRenamer()"><!-- --></A><H3>
PackageRenamer</H3>
<PRE>
public <B>PackageRenamer</B>()</PRE>
<DL>
<DD>The constructor of a PackageRenamer class.
<P>
</DL>
<HR>
<A NAME="PackageRenamer(java.lang.String)"><!-- --></A><H3>
PackageRenamer</H3>
<PRE>
public <B>PackageRenamer</B>(java.lang.String&nbsp;propertiesFileName)</PRE>
<DL>
</DL>
<HR>
<A NAME="PackageRenamer(java.lang.String[])"><!-- --></A><H3>
PackageRenamer</H3>
<PRE>
public <B>PackageRenamer</B>(java.lang.String[]&nbsp;args)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="bannerText()"><!-- --></A><H3>
bannerText</H3>
<PRE>
protected java.lang.String <B>bannerText</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="binaryCopy(java.io.File, java.io.File)"><!-- --></A><H3>
binaryCopy</H3>
<PRE>
public void <B>binaryCopy</B>(java.io.File&nbsp;inFile,
java.io.File&nbsp;outFile)
throws java.io.FileNotFoundException,
java.io.IOException</PRE>
<DL>
<DD>Do a binary copy of the file byte buffer by byte buffer.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.FileNotFoundException</CODE>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="bufferContainsNullChar(byte[], int)"><!-- --></A><H3>
bufferContainsNullChar</H3>
<PRE>
protected boolean <B>bufferContainsNullChar</B>(byte[]&nbsp;buffer,
int&nbsp;bufferLength)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="buildAndCheckDestinationFile(java.lang.String)"><!-- --></A><H3>
buildAndCheckDestinationFile</H3>
<PRE>
public java.io.File <B>buildAndCheckDestinationFile</B>(java.lang.String&nbsp;aDirString)</PRE>
<DL>
<DD>INTERNAL
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="buildAndCheckExistingDirFile(java.lang.String)"><!-- --></A><H3>
buildAndCheckExistingDirFile</H3>
<PRE>
public java.io.File <B>buildAndCheckExistingDirFile</B>(java.lang.String&nbsp;aDirString)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="buildAndCheckLogWriter(java.lang.String)"><!-- --></A><H3>
buildAndCheckLogWriter</H3>
<PRE>
public java.io.PrintWriter <B>buildAndCheckLogWriter</B>(java.lang.String&nbsp;logFileString)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="cleanup()"><!-- --></A><H3>
cleanup</H3>
<PRE>
protected void <B>cleanup</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="createDestinationDirectory(java.io.File)"><!-- --></A><H3>
createDestinationDirectory</H3>
<PRE>
public void <B>createDestinationDirectory</B>(java.io.File&nbsp;aDirectory)</PRE>
<DL>
<DD>This method creates an output directory for post-rename file(s).
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="directoryIsSubdirectory(java.io.File, java.io.File)"><!-- --></A><H3>
directoryIsSubdirectory</H3>
<PRE>
public static boolean <B>directoryIsSubdirectory</B>(java.io.File&nbsp;directory1,
java.io.File&nbsp;directory2)</PRE>
<DL>
<DD>Return true if directory2 is contained within directory1. Both directories must be absolute.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="existingDirectoryFromPrompt()"><!-- --></A><H3>
existingDirectoryFromPrompt</H3>
<PRE>
public java.io.File <B>existingDirectoryFromPrompt</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDefaultPropertiesFileName()"><!-- --></A><H3>
getDefaultPropertiesFileName</H3>
<PRE>
public static java.lang.String <B>getDefaultPropertiesFileName</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getReader()"><!-- --></A><H3>
getReader</H3>
<PRE>
public java.io.BufferedReader <B>getReader</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isExtensionSupported(java.lang.String)"><!-- --></A><H3>
isExtensionSupported</H3>
<PRE>
public boolean <B>isExtensionSupported</B>(java.lang.String&nbsp;extension)</PRE>
<DL>
<DD>Return true if the PackageRenamer should work on the given file extension.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="logln(java.lang.String)"><!-- --></A><H3>
logln</H3>
<PRE>
public void <B>logln</B>(java.lang.String&nbsp;str)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[]&nbsp;args)</PRE>
<DL>
<DD>Main method to run the PackageRenamer
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="parseFileExtension(java.io.File)"><!-- --></A><H3>
parseFileExtension</H3>
<PRE>
public java.lang.String <B>parseFileExtension</B>(java.io.File&nbsp;aFile)</PRE>
<DL>
<DD>Returns the extension of the given file. Returns and empty string if none was found.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="promptForDestinationDirectory()"><!-- --></A><H3>
promptForDestinationDirectory</H3>
<PRE>
protected java.io.File <B>promptForDestinationDirectory</B>()</PRE>
<DL>
<DD>INTERNAL
Prompt from System.in for an empty or non-existent directory to use as the destination directory.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="readChangesFile(java.lang.String)"><!-- --></A><H3>
readChangesFile</H3>
<PRE>
public java.util.Properties <B>readChangesFile</B>(java.lang.String&nbsp;filename)</PRE>
<DL>
<DD>This readChangesFile() method reads the given properties file to be a reference
for renaming TopLink package name.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="run()"><!-- --></A><H3>
run</H3>
<PRE>
public void <B>run</B>()</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="streamForNonExistentFilePrompt()"><!-- --></A><H3>
streamForNonExistentFilePrompt</H3>
<PRE>
protected java.io.PrintWriter <B>streamForNonExistentFilePrompt</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="runSearchAndReplacePackageName(java.io.File)"><!-- --></A><H3>
runSearchAndReplacePackageName</H3>
<PRE>
public void <B>runSearchAndReplacePackageName</B>(java.io.File&nbsp;sourceFile)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="replace(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>
replace</H3>
<PRE>
public static java.lang.String <B>replace</B>(java.lang.String&nbsp;str,
java.lang.String&nbsp;oldChars,
java.lang.String&nbsp;newChars)</PRE>
<DL>
<DD>Do a search and replace in a string.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the modified String</DL>
</DD>
</DL>
<HR>
<A NAME="returnNewFileNameIfRequired(java.lang.String)"><!-- --></A><H3>
returnNewFileNameIfRequired</H3>
<PRE>
public java.lang.String <B>returnNewFileNameIfRequired</B>(java.lang.String&nbsp;aSourceFileNameWithoutRoot)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="traverseSourceDirectory(java.io.File)"><!-- --></A><H3>
traverseSourceDirectory</H3>
<PRE>
public void <B>traverseSourceDirectory</B>(java.io.File&nbsp;aDirectoryString)</PRE>
<DL>
<DD>This traverseSourceDirectory() traverse source-root-directory, creating an corresponding output directory,
and calling another method for replacing old TopLink package name.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="usage()"><!-- --></A><H3>
usage</H3>
<PRE>
public static void <B>usage</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
EclipseLink 1.2.0, build 'v20091016-r5565' API Reference</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/eclipse/persistence/tools/PackageRenamer.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="PackageRenamer.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>