public interface FSFactory
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteIfExists(File file)
delete the file if it exists
|
BufferedInputStream |
getBufferedInputStream(String filePath)
get input stream
|
BufferedOutputStream |
getBufferedOutputStream(String filePath)
get output stream
|
BufferedReader |
getBufferedReader(String filePath)
get buffered reader
|
BufferedWriter |
getBufferedWriter(String filePath,
boolean append)
get buffered reader
|
File |
getFile(File parent,
String child)
get file
|
File |
getFile(String pathname)
get file
|
File |
getFile(String parent,
String child)
get file
|
File |
getFile(URI uri)
get file by uri
|
File |
getFileWithParent(String pathname)
get file with parent
|
File[] |
listFilesByPrefix(String fileFolder,
String prefix)
list file by prefix
|
File[] |
listFilesBySuffix(String fileFolder,
String suffix)
list file by suffix
|
void |
moveFile(File srcFile,
File destFile)
move file
|
File getFileWithParent(String pathname)
pathname - pathnameFile getFile(String parent, String child)
parent - parent file pathchild - child file pathFile getFile(File parent, String child)
parent - parent filechild - child file pathBufferedReader getBufferedReader(String filePath)
filePath - file pathBufferedWriter getBufferedWriter(String filePath, boolean append)
filePath - file pathappend - whether is appendBufferedInputStream getBufferedInputStream(String filePath)
filePath - file pathBufferedOutputStream getBufferedOutputStream(String filePath)
filePath - file pathvoid moveFile(File srcFile, File destFile)
srcFile - src filedestFile - dest fileFile[] listFilesBySuffix(String fileFolder, String suffix)
fileFolder - file foldersuffix - suffixFile[] listFilesByPrefix(String fileFolder, String prefix)
fileFolder - file folderprefix - prefixboolean deleteIfExists(File file) throws IOException
file - local file or HDFS fileIOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.