Enum Class FileUtil
- All Implemented Interfaces:
Serializable
,Comparable<FileUtil>
,Constable
Common file-utilities.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copy
(InputStream stream, File file) static FilenameFilter
static String
getBasename
(File file) static String
getBasename
(String file) static File
getConfigFile
(String configName) static String
getExtension
(String fileName) static dk.lockfuglsang.minecraft.yml.YmlConfiguration
getYmlConfiguration
(String configName) System-encoding agnostic config-reader Reads and returns the configuration found in:static dk.lockfuglsang.minecraft.yml.YmlConfiguration
loadConfig
(File file) static void
readConfig
(org.bukkit.configuration.file.FileConfiguration config, File file) static void
readConfig
(org.bukkit.configuration.file.FileConfiguration config, InputStream inputStream) static Properties
readProperties
(String fileName) static void
reload()
static void
setAllwaysOverwrite
(String... configs) static void
setDataFolder
(File dataFolder) static void
static void
setNeverOverwrite
(String... configs) static FileUtil
Returns the enum constant of this class with the specified name.static FileUtil[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
setAllwaysOverwrite
-
setNeverOverwrite
-
loadConfig
-
readConfig
-
readConfig
public static void readConfig(org.bukkit.configuration.file.FileConfiguration config, InputStream inputStream) -
createYmlFilenameFilter
-
getBasename
-
getBasename
-
getExtension
-
getYmlConfiguration
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
-
copy
- Throws:
IOException
-
setDataFolder
-
setLocale
-
reload
public static void reload() -
readProperties
-