com.g11ntoolkit.detokenizer
Class FileCopy

java.lang.Object
  |
  +--com.g11ntoolkit.detokenizer.FileCopy

public class FileCopy
extends java.lang.Object

Extracts the specified input file from the specified combined file to create the specified output file.

Version:
2005/06/24
Author:
Bill Rich, Wilandra Consulting LLC
Copyright © 2003-2005, Wilandra Consulting LLC. All rights reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See License Agreement.


Field Summary
protected static java.lang.String encoding
          The encoding for both the input and output files.
private static java.util.logging.Logger log
          The log used for all messages from this class.
protected static java.util.ResourceBundle mrb
          Message Resource Bundle.
protected  java.lang.String theContextFileName
          The context input file name saved for later use.
protected static java.util.ResourceBundle vrb
          Variables Resource Bundle.
 
Constructor Summary
FileCopy()
           
 
Method Summary
 void copy(JSStrFile jsstr, java.lang.String inFileName, java.lang.String contextFileName, java.lang.String outFileName, java.lang.String enc)
          Extracts the input file from the combined file to create the output file.
 java.lang.StringBuffer extractFile(java.lang.String inFileName, java.lang.StringBuffer comboFile)
          Extract the specified input file name from the combined file buffer.
 void FileCopy()
          Creates an instance of this class.
 java.lang.StringBuffer getScript(JSStrFile jsstr, java.lang.String inFileName)
          Reads in the specified file and stores it in the string buffer.
 java.lang.StringBuffer readFile(java.lang.String comboFileName)
          Reads in the specified file and stores it in the string buffer.
 void writeFile(java.lang.StringBuffer inFile, java.lang.String outFileName)
          Writes the contents of the input file into the output file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log
The log used for all messages from this class.


mrb

protected static java.util.ResourceBundle mrb
Message Resource Bundle.


vrb

protected static java.util.ResourceBundle vrb
Variables Resource Bundle.


encoding

protected static java.lang.String encoding
The encoding for both the input and output files.


theContextFileName

protected java.lang.String theContextFileName
The context input file name saved for later use.

Constructor Detail

FileCopy

public FileCopy()
Method Detail

FileCopy

public void FileCopy()
Creates an instance of this class.


copy

public void copy(JSStrFile jsstr,
                 java.lang.String inFileName,
                 java.lang.String contextFileName,
                 java.lang.String outFileName,
                 java.lang.String enc)
          throws FileCopyError
Extracts the input file from the combined file to create the output file.

Parameters:
jsstr - a JSStrFile
inFileName - a String specifying the name of the input file to extract
outFileName - a String specifying the name of the output file
enc - a String specifying the encoding for both the input and output files
Throws:
FileCopyError - for any errors

readFile

public java.lang.StringBuffer readFile(java.lang.String comboFileName)
                                throws FileCopyError
Reads in the specified file and stores it in the string buffer.

Parameters:
comboFileName - a String specifying the name of the file to read
Returns:
a StringBuffer representing the contents of the input file
Throws:
FileCopyError - for any errors

getScript

public java.lang.StringBuffer getScript(JSStrFile jsstr,
                                        java.lang.String inFileName)
                                 throws FileCopyError
Reads in the specified file and stores it in the string buffer.

Parameters:
jsstr - a JSStrFile
inFileName - a String specifying the name of the tag
Returns:
a StringBuffer representing the contents of the input file
Throws:
FileCopyError - for any errors

extractFile

public java.lang.StringBuffer extractFile(java.lang.String inFileName,
                                          java.lang.StringBuffer comboFile)
Extract the specified input file name from the combined file buffer.

Parameters:
inFileName - a String specifying the name of the file to extract
comboFile - a StringBuffer specifying the contents of the combined file
Returns:
a StringBuffer representing the contents of the extracted file

writeFile

public void writeFile(java.lang.StringBuffer inFile,
                      java.lang.String outFileName)
               throws FileCopyError
Writes the contents of the input file into the output file.

Parameters:
inFile - a StringBuffer specifying the contents of the input file
outFileName - a String specifying the name of the output file
Throws:
FileCopyError - for any errors