| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package com.primeton.damp.fileclient;
- import java.io.Closeable;
- import java.io.IOException;
- import java.io.OutputStream;
- import java.nio.file.Path;
- import java.util.List;
- import java.util.Properties;
- /**
- *
- *
- * X11 连接。 可选的子实现:FTP, SFTP 协议。使用完成请关闭 close
- *
- *
- * Created by 59850 on 2019/3/28.
- */
- public interface X11ClientHandler extends Closeable {
- /**
- * 根据 配置参数,重新连接 ftp
- * @param params
- * @throws IOException
- */
- public void reconnect(Properties params) throws IOException;
- /**
- * 写入文件,输出流
- * @param file 文件地址,绝对路径
- * @param overwrite 是否覆盖写入
- * @return
- * @throws IOException
- */
- public OutputStream writeFile(String file, boolean overwrite) throws IOException;
- /**
- * 创建目录,, 如 Linux: mkdir /dir/path, 如 /dir 不存在则报错
- * @param path
- * @return
- */
- public boolean mkdir(String path);
- /**
- * 创建目录,多层级创建, 如 Linux: mkdir -p /dir/path
- * @param path
- * @return
- */
- public boolean mkdirs(String path);
- /**
- * 获取子目录或子文件
- * @param ftpPath
- * @return
- */
- public List<Path> getChildren(String ftpPath);
- /**
- * 判断是否存在该路径,无论文件夹或者文件
- * @param path
- * @return 返回 true 则存在
- */
- public boolean exists(String path);
- /**
- * 判断是否存在该文件夹
- * @param path 文件夹地址
- * @return 返回 true 则存在
- */
- public boolean existsDir(String path);
- /**
- * 判断是否存在该文件
- * @param path 文件地址
- * @return 返回 true 则存在
- */
- public boolean existsFile(String path);
- }
|