Package com.softwaremining.jcl
Class CopyFile
java.lang.Object
com.softwaremining.jcl.CopyFile
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconvertFromRecordToLineSequential(String inputFileName, int readSize, String outputFileName) Utility program to convert data files from Record to Line sequential.
NOTE: it may not work well with structures containing OCCURS-DEPENDINGstatic voidCopy a filestatic voidcopy a file from sourceFileName to targetFileNamestatic voidfinal StringnextWithException_UseExactRecordLenght(InputStream fis, int overridingReadSize, int defaultRecordSize) Load the content of the file into a ListreadInputData(String fileName, int readSize) Load the content of the file into a ListreadInputDataAux(String fileName, int readSize) read the next record from file.readInputDataAux2(String fileName, int readSize, boolean fixedLengthRecord) static voidwriteOutputData(String fileName, String data) Write the data (String) to the named filestatic voidwriteOutputData(String fileName, List<String> outputData) write data to a LINE-SEQUENTIAL filestatic voidwriteOutputData(String fileName, List<String> outputData, boolean saveAsLineSeq) static voidwriteOutputData(String fileName, List<String> outputData, boolean saveAsLineSeq, boolean removeBlanks) Can save data as line or record sequential file
-
Field Details
-
CRLFcharCount
public int CRLFcharCount
-
-
Constructor Details
-
CopyFile
public CopyFile()
-
-
Method Details
-
readFile
Load the content of the file into a List- Parameters:
fileName-- Returns:
- List
containing the content - Throws:
Exception
-
readInputData
Load the content of the file into a List- Parameters:
fileName-readSize- - specify 0 or anticipated size of a record- Returns:
- List
containing the content - Throws:
Exception
-
readInputDataAux
public static List<String> readInputDataAux(String fileName, int readSize) throws IOCriticalException, AtEndException read the next record from file. At end throw an exception- Throws:
IOCriticalExceptionAtEndException
-
readInputDataAux2
public static List<String> readInputDataAux2(String fileName, int readSize, boolean fixedLengthRecord) throws IOCriticalException, AtEndException - Throws:
IOCriticalExceptionAtEndException
-
nextWithException_UseExactRecordLenght
public final String nextWithException_UseExactRecordLenght(InputStream fis, int overridingReadSize, int defaultRecordSize) throws IOCriticalException, IOException - Throws:
IOCriticalExceptionIOException
-
writeOutputData
write data to a LINE-SEQUENTIAL file- Parameters:
fileName-outputData-- Throws:
Exception
-
writeOutputData
public static void writeOutputData(String fileName, List<String> outputData, boolean saveAsLineSeq) throws Exception - Throws:
Exception
-
writeOutputData
public static void writeOutputData(String fileName, List<String> outputData, boolean saveAsLineSeq, boolean removeBlanks) throws Exception Can save data as line or record sequential file- Parameters:
fileName-outputData-saveAsLineSeq-- Throws:
Exception
-
writeOutputData
Write the data (String) to the named file- Parameters:
fileName-data-- Throws:
Exception
-
convertFromRecordToLineSequential
public static void convertFromRecordToLineSequential(String inputFileName, int readSize, String outputFileName) throws Exception Utility program to convert data files from Record to Line sequential.
NOTE: it may not work well with structures containing OCCURS-DEPENDING- Parameters:
inputFileName-readSize-outputFileName-- Throws:
Exception
-
copy
Copy a file- Parameters:
sourceFileName-destFileName-- Throws:
IOException
-
execute
copy a file from sourceFileName to targetFileName- Parameters:
sourceFileName-targetFileName-- Throws:
Exception
-
main
- Parameters:
args-
-