public interface BaseFileSystem
| 限定符和类型 | 方法和说明 |
|---|---|
void |
create(String path) |
void |
deleteFile(String file)
删除文件
|
default void |
downloadFile(String file,
FileInfo localPath)
下载文件
|
List<FileInfo> |
getDirFiles(String file)
查看目录下文件
|
FileInfo |
getFiles(String file)
查看当前文件信息
|
InputStream |
getInputStream(String file)
获取输入流
|
OutputStream |
getOutputStream(String file)
获取输入流
|
boolean |
isFileExist(String hdfsPath)
文件是否存在
|
void |
mkdirs(String path) |
default void |
uploadFile(FileInfo localPath,
String file)
上传文件
|
void deleteFile(String file) throws IOException
file - IOExceptionvoid mkdirs(String path) throws IOException
IOExceptionvoid create(String path) throws IOException
IOExceptionInputStream getInputStream(String file) throws IOException
file - IOExceptionOutputStream getOutputStream(String file) throws IOException
file - IOExceptiondefault void uploadFile(FileInfo localPath, String file) throws IOException
localPath - 本地文件路径file - 上传至hdfs文件路径IOExceptiondefault void downloadFile(String file, FileInfo localPath) throws IOException
file - hdfs文件路径localPath - 下载至本地路径IOExceptionboolean isFileExist(String hdfsPath) throws IOException
hdfsPath - hdfs文件路径IOExceptionList<FileInfo> getDirFiles(String file) throws IOException
file - 目录路径IOExceptionFileInfo getFiles(String file) throws IOException
file - 目录路径IOExceptionCopyright © 2022. All rights reserved.