Class WriteFile

java.lang.Object
org.jpass.utils.WriteFile

public class WriteFile extends Object
This class is used to write into a file
  • Constructor Details

    • WriteFile

      public WriteFile()
  • Method Details

    • create

      public static void create(String filePath)
      Create a file
      Parameters:
      filePath - path to the file
    • write

      public static void write(String filePath, String text)
      Write into a file
      Parameters:
      filePath - path to the file
      text - text to write into the file
    • write

      public static void write(String filePath, String text, int split)
      Append text into a config file Make copy (.copy file), read from copy and write into original file, replace specific line, delete copy
      Parameters:
      filePath - path to the file
      text - text to append into the file
    • CopyFile

      public static void CopyFile(String filePath)
      Copy a file and save it as .copy file - used as a helper in append method
      Parameters:
      filePath - path to the file
    • CopyFile

      public static void CopyFile(String filePath, String newFilePath)
      Copy a file
      Parameters:
      filePath - String path to the file
      newFilePath - String path to the new file
    • CopyFile

      public static void CopyFile(Path filePath, String newFilePath)
      Copy a file
      Parameters:
      filePath - Path to the file
      newFilePath - String path to the new file
    • RemoveFile

      public static void RemoveFile(String filePath)
      Remove a file
      Parameters:
      filePath - path to the file