Class ResDir

All Implemented Interfaces:
Closeable, AutoCloseable

public class ResDir extends VirtualContainer
资源目录
Since:
2020-4-3 19:41:32
Author:
权观宇
  • Constructor Details

  • Method Details

    • add

      public ResDir add(Path res) throws IOException
      向目录中加入资源

      加入的资源将会被复制到指定目录,与原有资源无关。

      若存在同名文件,那么被加入文件将重命名,若你需要获取重名后的文件信息请使用 VirtualContainer.putFileWithPath(Path)

      Parameters:
      res - 资源
      Returns:
      this
      Throws:
      IOException - 文件复制过程中发生的异常
    • addWithPath

      public Path addWithPath(Path res) throws IOException
      向目录中加入资源

      加入的资源将会被复制到指定目录,与原有资源无关

      若存在同名文件,那么被加入文件将重命名,重名后的文件以返还值形式返回。

      Parameters:
      res - 资源
      Returns:
      加入后文件在容器的绝对路径
      Throws:
      IOException - 文件复制过程中发生的异常
    • get

      public Path get(String name) throws FileNotFoundException
      获取容器中的资源
      Parameters:
      name - 资源名称(包含后缀)
      Returns:
      容器中的资源路径
      Throws:
      FileNotFoundException - 文件不存在