Enum Class FileUtil

java.lang.Object
java.lang.Enum<FileUtil>
dk.lockfuglsang.minecraft.file.FileUtil
All Implemented Interfaces:
Serializable, Comparable<FileUtil>, Constable

public enum FileUtil extends Enum<FileUtil>
Common file-utilities.
  • Method Details

    • values

      public static FileUtil[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FileUtil valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • setAllwaysOverwrite

      public static void setAllwaysOverwrite(String... configs)
    • setNeverOverwrite

      public static void setNeverOverwrite(String... configs)
    • loadConfig

      public static YmlConfiguration loadConfig(File file)
    • readConfig

      public static void readConfig(org.bukkit.configuration.file.FileConfiguration config, File file)
    • readConfig

      public static void readConfig(org.bukkit.configuration.file.FileConfiguration config, InputStream inputStream)
    • createYmlFilenameFilter

      public static FilenameFilter createYmlFilenameFilter()
    • getBasename

      public static String getBasename(File file)
    • getBasename

      public static String getBasename(String file)
    • getExtension

      public static String getExtension(String fileName)
    • getYmlConfiguration

      public static YmlConfiguration getYmlConfiguration(String configName)
      System-encoding agnostic config-reader Reads and returns the configuration found in:
         a) the datafolder
      
           a.1) if a config named "config_en.yml" exists - that is read.
      
           a.2) otherwise "config.yml" is read (created if need be).
      
         b) if the version differs from the same resource on the classpath
      
            b.1) all nodes in the jar-file-version is merged* into the local-file
      
            b.2) unless the configName is in the allwaysOverwrite - then the jar-version wins
      
       *merged: using data-conversion of special nodes.
       
    • getConfigFile

      public static File getConfigFile(String configName)
    • copy

      public static void copy(InputStream stream, File file) throws IOException
      Throws:
      IOException
    • setDataFolder

      public static void setDataFolder(File dataFolder)
    • setLocale

      public static void setLocale(Locale loc)
    • reload

      public static void reload()
    • readProperties

      public static Properties readProperties(String fileName)