パッケージ org.nkjmlab.util.java.io

クラス FileUtils

java.lang.Object
org.nkjmlab.util.java.io.FileUtils

public class FileUtils extends Object
  • コンストラクタの詳細

    • FileUtils

      public FileUtils()
  • メソッドの詳細

    • getTempDirectory

      public static File getTempDirectory()
      Getting a temp file object of the temporal directory which is referrenced by System.getProperty("java.io.tmpdir").
      戻り値:
    • getTempDirectoryPath

      public static Path getTempDirectoryPath()
      Getting a path object of the temporal directory which is referrenced by System.getProperty("java.io.tmpdir").
      戻り値:
    • getTempDirectoryPathString

      public static String getTempDirectoryPathString()
      Getting a string object of the temporal directory which is referrenced by System.getProperty("java.io.tmpdir").
      戻り値:
    • getUserDirectory

      public static File getUserDirectory()
      Getting a file object of the temporal directory which is referrenced by System.getProperty("user.home").
      戻り値:
    • getUserDirectoryPath

      public static Path getUserDirectoryPath()
      Getting a path object of the directory which is referenced by System.getProperty("user.home").
      戻り値:
    • getUserHomeDirectoryPathString

      public static String getUserHomeDirectoryPathString()
      Getting a string object of the directory which is referenced by System.getProperty("user.home").
      戻り値:
    • getCurrentDirectoryPathString

      public static String getCurrentDirectoryPathString()
    • getCurrentDirectory

      public static File getCurrentDirectory()
    • getFileInCurrentDirectory

      public static File getFileInCurrentDirectory(String relativePath)
    • getTempFile

      public static File getTempFile(File parent, String fileName)
      Getting a temp file object in the directory in temporal directory which is referrenced by System.getProperty("java.io.tmpdir").
      パラメータ:
      parent -
      fileName -
      戻り値:
    • getTempFile

      public static File getTempFile(String fileName)
      Getting a temp file object in the temporal directory which is referrenced by System.getProperty("java.io.tmpdir").
      パラメータ:
      fileName -
      戻り値:
    • getFileInUserDirectory

      public static File getFileInUserDirectory(String fileName)
      Getting a file object in the user directory which is referrenced by System.getProperty("user.home").
      パラメータ:
      fileName -
      戻り値:
    • getFileInUserDirectory

      public static File getFileInUserDirectory(File parent, String fileName)
      Getting a file object in the user directory which is referrenced by System.getProperty("user.home").
      パラメータ:
      parent -
      fileName -
      戻り値:
    • getFileReader

      public static FileReader getFileReader(String fileName)
      Getting a file reader of fileName
      パラメータ:
      fileName -
      戻り値:
    • getFileReader

      public static FileReader getFileReader(File file)
      Getting a file reader of file
      パラメータ:
      fileName -
      戻り値:
    • getFileWriter

      public static FileWriter getFileWriter(String fileName)
      Getting a file writer of fileName
      パラメータ:
      fileName -
      戻り値:
    • getFileWriter

      public static FileWriter getFileWriter(File file)
      Getting a file writer of file
      パラメータ:
      fileName -
      戻り値:
    • getFileWriter

      public static FileWriter getFileWriter(File file, boolean append)
      Getting a file writer of file with the option of append.
      パラメータ:
      file -
      append -
      戻り値:
    • newBufferedReader

      public static BufferedReader newBufferedReader(Path path)
    • newBufferedReader

      public static BufferedReader newBufferedReader(Path path, Charset cs)
    • newBufferedWriter

      public static BufferedWriter newBufferedWriter(Path path, Charset cs, OpenOption... options)
    • newBufferedWriter

      public static BufferedWriter newBufferedWriter(Path path, OpenOption... options)
    • write

      public static Path write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options)
    • write

      public static Path write(Path path, Iterable<? extends CharSequence> lines, OpenOption... options)
    • write

      public static Path write(Path path, String line, Charset cs, OpenOption... options)
    • write

      public static Path write(Path path, String line, OpenOption... options)
    • readAllBytes

      public static byte[] readAllBytes(Path path)
    • write

      public static Path write(Path path, byte[] bytes, OpenOption... options)
    • readAllLines

      public static List<String> readAllLines(Path path, Charset cs)
    • lines

      public static Stream<String> lines(Path path)
    • lines

      public static Stream<String> lines(Path path, Charset cs)
    • readAllLines

      public static List<String> readAllLines(Path path)
    • getAllFiles

      public static List<File> getAllFiles(File dir)
    • forEachFileInDirInParallel

      public static void forEachFileInDirInParallel(File dir, Consumer<File> consumer)
    • forEachFileInDir

      public static void forEachFileInDir(File dir, Consumer<File> consumer)