类 CoreUtil.FILE

  • 封闭类:
    CoreUtil

    public static class CoreUtil.FILE
    extends Object
    文件相关工具类
    • 构造器详细资料

      • FILE

        public FILE()
    • 方法详细资料

      • getTextFromResource

        public static String getTextFromResource​(String path)
        get text content from file that exists in classpath 从类路径读取文件文本内容
        参数:
        path - where file located under classpath, path with filename
        返回:
        file content in text
      • getTextFromFile

        public static String getTextFromFile​(String path)
        get text content from exists file in specified path 从指定路径读取文件文本内容
        参数:
        path - where file located, path with filename
        返回:
        file content in text
      • saveToFile

        public static void saveToFile​(InputStream inputStream,
                                      String fileName)
        将输入流保存到指定文件中
        参数:
        inputStream - 输入流
        fileName - 要保存的目标文件