Package com.softwaremining.jcl
Class CopyFile
java.lang.Object
com.softwaremining.jcl.CopyFile
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
convertFromRecordToLineSequential
(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 void
Copy a filestatic void
copy a file from sourceFileName to targetFileNamestatic void
final String
nextWithException_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 void
writeOutputData
(String fileName, String data) Write the data (String) to the named filestatic void
writeOutputData
(String fileName, List<String> outputData) write data to a LINE-SEQUENTIAL filestatic void
writeOutputData
(String fileName, List<String> outputData, boolean saveAsLineSeq) 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:
IOCriticalException
AtEndException
-
readInputDataAux2
public static List<String> readInputDataAux2(String fileName, int readSize, boolean fixedLengthRecord) throws IOCriticalException, AtEndException - Throws:
IOCriticalException
AtEndException
-
nextWithException_UseExactRecordLenght
public final String nextWithException_UseExactRecordLenght(InputStream fis, int overridingReadSize, int defaultRecordSize) throws IOCriticalException, IOException - Throws:
IOCriticalException
IOException
-
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 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
-
-