Class FileUtil

java.lang.Object
com.github.fungal.api.util.FileUtil

public class FileUtil extends Object
An utility for JAR type files
Author:
Jesper Pedersen
  • Constructor Details

    • FileUtil

      public FileUtil()
      Constructor
  • Method Details

    • compress

      public void compress(File directory, File target) throws IOException
      Compress a directory in a JAR layout to a file
      Parameters:
      directory - The directory
      target - The JAR file
      Throws:
      IOException - Thrown if an error occurs
    • extract

      public File extract(File file, File directory) throws IOException
      Extract a JAR type file
      Parameters:
      file - The file
      directory - The directory where the file should be extracted
      Returns:
      The root of the extracted JAR file
      Throws:
      IOException - Thrown if an error occurs
    • copy

      public void copy(File src, File dest) throws IOException
      Copy
      Parameters:
      src - The source
      dest - The destination
      Throws:
      IOException - Thrown if a file could not be deleted
    • delete

      public void delete(File f) throws IOException
      Recursive delete
      Parameters:
      f - The file handler
      Throws:
      IOException - Thrown if a file could not be deleted