Class ResourceExtractor

java.lang.Object
studio.magemonkey.codex.config.ResourceExtractor

public final class ResourceExtractor extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResourceExtractor(org.bukkit.plugin.java.JavaPlugin plugin, File extractFolder, String folderPath, String regex)
    You can extract complete folders of resources from your plugin jar to a target folder.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Starts extracting the files.
    void
    extract(boolean override)
    Starts extracting the files.
    void
    extract(boolean override, boolean subPaths)
    Starts extracting the files.

    Methods inherited from class java.lang.Object

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

    • ResourceExtractor

      public ResourceExtractor(org.bukkit.plugin.java.JavaPlugin plugin, File extractFolder, String folderPath, String regex)
      You can extract complete folders of resources from your plugin jar to a target folder. You can append a regex to match the file names.
      Parameters:
      plugin - The plugin the files will be extracted from.
      extractFolder - The folder where the files will be extracted to.
      folderPath - The path where the files are inside in the jar located.
      regex - A regex to match the file names. This can be 'null' if you don't want to use it.
  • Method Details

    • extract

      public void extract() throws IOException
      Starts extracting the files.
      Throws:
      IOException
    • extract

      public void extract(boolean override) throws IOException
      Starts extracting the files.
      Parameters:
      override - Whether you want to override the old files.
      Throws:
      IOException
    • extract

      public void extract(boolean override, boolean subPaths) throws IOException
      Starts extracting the files.
      Parameters:
      override - Whether you want to override the old files.
      subPaths - Whether you want to create sub folders if it's also found in the jar file.
      Throws:
      IOException