Interface FileObject


  • public interface FileObject
    用于IO的文件操作接口
    • Method Detail

      • delete

        boolean delete​(String path)
                throws GraphDbFileIOException
        删除文件/文件夹。 文件:若删除成功,返回true。若删除失败,返回false。 文件夹:若文件夹中有文件,则抛出异常
        Parameters:
        path - 文件/文件夹路径
        Returns:
        true删除成功,false删除失败
        Throws:
        GraphDbFileIOException - IO异常
      • deleteForce

        boolean deleteForce​(String path)
                     throws GraphDbFileIOException
        强制删除文件/文件夹。 文件:若删除成功,返回true。若删除失败,返回false。 文件夹:删除所有文件
        Parameters:
        path - 文件/文件夹路径
        Returns:
        true删除成功,false删除失败
        Throws:
        GraphDbFileIOException - IO异常
      • sendFile

        boolean sendFile​(int affinity,
                         String path,
                         boolean overwrite)
                  throws GraphDbFileIOException
        指定affinity,同步发送文件。若远端不存在文件夹,默认为远端创建。单机版不可用。
        Parameters:
        affinity - 节点编号
        path - 文件路径
        overwrite - 若远端有同盟文件是否覆盖。true覆盖,false跳过
        Returns:
        true发送成功,false发送失败
        Throws:
        GraphDbFileIOException - IO异常
      • sendFileAsync

        Future<Boolean> sendFileAsync​(int affinity,
                                      String path,
                                      boolean overwrite)
        指定affinity,异步发送文件。若远端不存在文件夹,默认为远端创建。单机版不可用。
        Parameters:
        affinity - 节点编号
        path - 文件路径
        overwrite - 若远端有同盟文件是否覆盖。true覆盖,false跳过
        Returns:
        异步对象