类 FileParser
- java.lang.Object
-
- cn.mcres.gyhhy.MXLib.FileParser
-
public class FileParser extends Object
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
FileParser.RunResponse<T>
-
方法概要
修饰符和类型 方法 说明 static FileParser.RunResponse<FileConfiguration>
copyAndLoad(Plugin main, String path)
static FileParser.RunResponse<Properties>
copyAndLoadProperties(Plugin main, String path)
static <T> FileParser.RunResponse<T>
copyFile(Plugin pl, String path, boolean cover)
复制一个文件static FileConfiguration
load(String path)
-
-
-
方法详细资料
-
copyFile
public static <T> FileParser.RunResponse<T> copyFile(Plugin pl, String path, boolean cover) throws IOException
复制一个文件- 类型参数:
T
- 一个自定义的结果, 供其他模块使用(执行执行copyFile获取的param永远是null)- 参数:
pl
- 主插件path
- 路径cover
- 是否覆盖(当为false时,插件文件目录存在文件时将不会执行任何操作)- 返回:
- 执行结果
- 抛出:
IOException
- io错误NullPointerException
- 插件/路径为null时报错FileNotFoundException
-FileOutputStream
初始化错误
-
copyAndLoadProperties
public static FileParser.RunResponse<Properties> copyAndLoadProperties(Plugin main, String path) throws IOException
- 参数:
main
- 主插件path
- 路径- 返回:
- 执行结果,使用 ${returnvalue}.param 获取
- 抛出:
IOException
- IO错误FileNotFoundException
- IO错误
-
copyAndLoad
public static FileParser.RunResponse<FileConfiguration> copyAndLoad(Plugin main, String path) throws IOException, InvalidConfigurationException
- 参数:
main
- 主插件path
- 路径- 返回:
- 执行结果,使用 ${returnvalue}.param 获取
- 抛出:
IOException
- IO错误FileNotFoundException
- IO错误InvalidConfigurationException
- Yaml读取错误
-
load
public static FileConfiguration load(String path) throws IOException, InvalidConfigurationException
-
-