Package ceit.utils

Class FileUtils

java.lang.Object
ceit.utils.FileUtils

public class FileUtils
extends java.lang.Object
Mange files - Read and Write
  • Constructor Summary

    Constructors 
    Constructor Description
    FileUtils()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String fileReader​(java.io.File file)
    Read files with BufferedReader
    static java.lang.String fileReader2​(java.io.File file)
    Read files with FileInputStream
    static void fileWriter​(java.lang.String content)
    Write given string to file with Buffered Reader
    static void fileWriter2​(java.lang.String content)
    Write to file with FileOutputStream
    static java.io.File[] getFilesInDirectory()
    get list of files
    static java.lang.String readObject​(java.io.File file)
    read object
    static void writeObject​(java.lang.String content)
    write given string as objects to file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getFilesInDirectory

      public static java.io.File[] getFilesInDirectory()
      get list of files
      Returns:
      list of files
    • fileReader

      public static java.lang.String fileReader​(java.io.File file) throws java.io.IOException
      Read files with BufferedReader
      Parameters:
      file - given file
      Returns:
      content of file
      Throws:
      java.io.IOException
    • fileWriter

      public static void fileWriter​(java.lang.String content) throws java.io.IOException
      Write given string to file with Buffered Reader
      Parameters:
      content - given string
      Throws:
      java.io.IOException
    • fileReader2

      public static java.lang.String fileReader2​(java.io.File file) throws java.io.IOException
      Read files with FileInputStream
      Parameters:
      file - given file
      Returns:
      content of file
      Throws:
      java.io.IOException
    • fileWriter2

      public static void fileWriter2​(java.lang.String content) throws java.io.IOException
      Write to file with FileOutputStream
      Parameters:
      content - given string
      Throws:
      java.io.IOException
    • readObject

      public static java.lang.String readObject​(java.io.File file) throws java.io.IOException
      read object
      Parameters:
      file - given object as a file
      Returns:
      content of file
      Throws:
      java.io.IOException
    • writeObject

      public static void writeObject​(java.lang.String content) throws java.io.IOException
      write given string as objects to file
      Parameters:
      content - given string
      Throws:
      java.io.IOException