com.bankframe.admin.tools.migrate
Class MigrateTool

java.lang.Object
  extended bycom.bankframe.admin.tools.migrate.MigrateTool

public class MigrateTool
extends java.lang.Object

Migration tool, used to update import statements in java files Creation date: (5/24/00 3:56:15 PM)
Usage:

  1. java com.bankframe.admin.tools.migrate.MigrateTool [-r TextToReplace.properties] [-f] -p file.java

Options:
  1. -r Path of the properties file containing the text to search and replace
  2. -f Force read-only files to be overwritten
  3. -p Path of the file or directory to process
The TextToReplace.properties file is a standard properties file used to specify what text to replace, and what to replace the text with. The key field denotes the text to be replaced , while the value field denotes the text to replace it with.
Example
#oldtext=newtext
com.bankframe.old.package=com.bankframe.new.package

Author:
ETU

Constructor Summary
MigrateTool(java.lang.String replaceTextPath, java.io.File fileToProcess)
          MigrateTool constructor
 
Method Summary
static void displayUsage()
          Display this tools' usage information
 void loadTextToReplace(java.lang.String propertiesPath)
          This method loads the specified properties file
static void main(java.lang.String[] args)
          This method starts the application.
 void processDirectory(java.io.File dirToProcess)
          This method processes a directory of Java files
 void processFile(java.io.File file)
          This method processes a single file
 boolean searchAndReplace(java.io.Reader in, java.io.Writer out)
          This mehod does a search and replace the specified input stream, writing changes to the output stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MigrateTool

public MigrateTool(java.lang.String replaceTextPath,
                   java.io.File fileToProcess)
MigrateTool constructor

Parameters:
replaceTextPath - Path to the properties file containing text that should be replaced
fileToProcess - Path of the file ( or directory ) to process
Method Detail

displayUsage

public static void displayUsage()
Display this tools' usage information


loadTextToReplace

public void loadTextToReplace(java.lang.String propertiesPath)
                       throws java.io.IOException
This method loads the specified properties file

Parameters:
propertiesPath - Path to the properties file
Throws:
java.lang.Exception
java.io.IOException

main

public static void main(java.lang.String[] args)
This method starts the application.

Parameters:
args - an array of command-line arguments

processDirectory

public void processDirectory(java.io.File dirToProcess)
                      throws java.io.IOException
This method processes a directory of Java files

Parameters:
dirToProcess - Path of directory to process
Throws:
java.io.IOException - Thrown if an error occurs processing the directory

processFile

public void processFile(java.io.File file)
                 throws java.io.IOException
This method processes a single file

Throws:
java.io.IOException - Thrown if the file does not exist or is read only

searchAndReplace

public boolean searchAndReplace(java.io.Reader in,
                                java.io.Writer out)
                         throws java.io.IOException
This mehod does a search and replace the specified input stream, writing changes to the output stream

Parameters:
in - java.io.Reader Input stream
out - java.io.Writer Output stream
Returns:
True if the output stream contains any changes, false otherwise
Throws:
java.io.IOException - Thrown if an error occurs reading from or writing to the streams


Copyright © 2004 Siebel Systems, Inc. All rights reserved.