Class ModifyFileExtensions

java.lang.Object
io.github.astrapi69.file.modify.ModifyFileExtensions

public final class ModifyFileExtensions extends Object
The class ModifyFileExtensions provides methods for modifying files
  • Method Details

    • concatenateAll

      public static void concatenateAll(List<File> textFiles, File resultTextFile) throws IOException
      Concatenates the content of the given list of text files into a single result text file
      Parameters:
      textFiles - the list of text files to concatenate
      resultTextFile - the result text file where the concatenated content will be stored
      Throws:
      IOException - if an I/O error occurs during reading from text files or writing to the result text file
    • modifyFile

      public static void modifyFile(Path inFilePath, Charset charsetOfOutputFile, FileChangeable modifier) throws IOException
      Modifies the input file line by line and writes the modification in the same file
      Parameters:
      inFilePath - the in file path
      charsetOfOutputFile - the charset of output file
      modifier - the modifier BiFunction
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • modifyFile

      public static void modifyFile(Path inFilePath, FileChangeable modifier) throws IOException
      Modifies the input file line by line and writes the modification in the same file
      Parameters:
      inFilePath - the in file path
      modifier - the modifier BiFunction
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • modifyFile

      public static void modifyFile(Path inFilePath, Path outFilePath, Charset charsetOfOutputFile, FileChangeable modifier) throws IOException
      Modifies the input file line by line and writes the modification in the new output file.
      Parameters:
      inFilePath - the in file path
      outFilePath - the out file path
      charsetOfOutputFile - the charset of output file
      modifier - the modifier BiFunction
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • modifyFile

      public static void modifyFile(Path inFilePath, Path outFilePath, FileChangeable modifier) throws IOException
      Modifies the input file line by line and writes the modification in the new output file
      Parameters:
      inFilePath - the in file path
      outFilePath - the out file path
      modifier - the modifier BiFunction
      Throws:
      IOException - Signals that an I/O exception has occurred.