Class CopyFile

java.lang.Object
com.softwaremining.jcl.CopyFile

public class CopyFile extends Object
  • Field Details

    • CRLFcharCount

      public int CRLFcharCount
  • Constructor Details

    • CopyFile

      public CopyFile()
  • Method Details

    • readFile

      public static List<String> readFile(String fileName) throws Exception
      Load the content of the file into a List
      Parameters:
      fileName -
      Returns:
      List containing the content
      Throws:
      Exception
    • readInputData

      public static List<String> readInputData(String fileName, int readSize) throws Exception
      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

      public static void writeOutputData(String fileName, List<String> outputData) throws Exception
      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

      public static void writeOutputData(String fileName, String data) throws Exception
      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

      public static void copy(String sourceFileName, String destFileName) throws IOException
      Copy a file
      Parameters:
      sourceFileName -
      destFileName -
      Throws:
      IOException
    • execute

      public static void execute(String sourceFileName, String targetFileName) throws Exception
      copy a file from sourceFileName to targetFileName
      Parameters:
      sourceFileName -
      targetFileName -
      Throws:
      Exception
    • main

      public static void main(String[] args)
      Parameters:
      args -