| Constructor and Description |
|---|
LocalFSFactory() |
| 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
|
public File getFileWithParent(String pathname)
FSFactorygetFileWithParent in interface FSFactorypathname - pathnamepublic File getFile(String parent, String child)
FSFactorypublic File getFile(File parent, String child)
FSFactorypublic BufferedReader getBufferedReader(String filePath)
FSFactorygetBufferedReader in interface FSFactoryfilePath - file pathpublic BufferedWriter getBufferedWriter(String filePath, boolean append)
FSFactorygetBufferedWriter in interface FSFactoryfilePath - file pathappend - whether is appendpublic BufferedInputStream getBufferedInputStream(String filePath)
FSFactorygetBufferedInputStream in interface FSFactoryfilePath - file pathpublic BufferedOutputStream getBufferedOutputStream(String filePath)
FSFactorygetBufferedOutputStream in interface FSFactoryfilePath - file pathpublic void moveFile(File srcFile, File destFile)
FSFactorypublic File[] listFilesBySuffix(String fileFolder, String suffix)
FSFactorylistFilesBySuffix in interface FSFactoryfileFolder - file foldersuffix - suffixpublic File[] listFilesByPrefix(String fileFolder, String prefix)
FSFactorylistFilesByPrefix in interface FSFactoryfileFolder - file folderprefix - prefixpublic boolean deleteIfExists(File file) throws IOException
FSFactorydeleteIfExists in interface FSFactoryfile - local file or HDFS fileIOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.