Class HybridFSFactory
- java.lang.Object
-
- org.apache.iotdb.tsfile.fileSystem.fsFactory.HybridFSFactory
-
-
Constructor Summary
Constructors Constructor Description HybridFSFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFile(File srcFile, File destFile)copy filevoiddeleteDirectory(String dir)Force delete the directorybooleandeleteIfExists(File file)delete the file if it existsBufferedInputStreamgetBufferedInputStream(String filePath)get input streamBufferedOutputStreamgetBufferedOutputStream(String filePath)get output streamBufferedReadergetBufferedReader(String filePath)get buffered readerBufferedWritergetBufferedWriter(String filePath, boolean append)get buffered readerFilegetFile(File parent, String child)get fileFilegetFile(String pathname)get fileFilegetFile(String parent, String child)get fileFilegetFile(URI uri)get file by uriFilegetFileWithParent(String pathname)get file with parentFile[]listFilesByPrefix(String fileFolder, String prefix)list file by prefixFile[]listFilesBySuffix(String fileFolder, String suffix)list file by suffixvoidmoveFile(File srcFile, File destFile)move file
-
-
-
Method Detail
-
getFileWithParent
public File getFileWithParent(String pathname)
Description copied from interface:FSFactoryget file with parent- Specified by:
getFileWithParentin interfaceFSFactory- Parameters:
pathname- pathname- Returns:
- file with parent
-
getFile
public File getFile(String parent, String child)
Description copied from interface:FSFactoryget file
-
getFile
public File getFile(File parent, String child)
Description copied from interface:FSFactoryget file
-
getBufferedReader
public BufferedReader getBufferedReader(String filePath)
Description copied from interface:FSFactoryget buffered reader- Specified by:
getBufferedReaderin interfaceFSFactory- Parameters:
filePath- file path- Returns:
- buffered reader
-
getBufferedWriter
public BufferedWriter getBufferedWriter(String filePath, boolean append)
Description copied from interface:FSFactoryget buffered reader- Specified by:
getBufferedWriterin interfaceFSFactory- Parameters:
filePath- file pathappend- whether is append- Returns:
- buffered reader
-
getBufferedInputStream
public BufferedInputStream getBufferedInputStream(String filePath)
Description copied from interface:FSFactoryget input stream- Specified by:
getBufferedInputStreamin interfaceFSFactory- Parameters:
filePath- file path- Returns:
- input stream
-
getBufferedOutputStream
public BufferedOutputStream getBufferedOutputStream(String filePath)
Description copied from interface:FSFactoryget output stream- Specified by:
getBufferedOutputStreamin interfaceFSFactory- Parameters:
filePath- file path- Returns:
- output stream
-
moveFile
public void moveFile(File srcFile, File destFile) throws IOException
Description copied from interface:FSFactorymove file- Specified by:
moveFilein interfaceFSFactory- Parameters:
srcFile- src filedestFile- dest file- Throws:
IOException
-
copyFile
public void copyFile(File srcFile, File destFile) throws IOException
Description copied from interface:FSFactorycopy file- Specified by:
copyFilein interfaceFSFactory- Parameters:
srcFile- src filedestFile- dest file- Throws:
IOException
-
listFilesBySuffix
public File[] listFilesBySuffix(String fileFolder, String suffix)
Description copied from interface:FSFactorylist file by suffix- Specified by:
listFilesBySuffixin interfaceFSFactory- Parameters:
fileFolder- file foldersuffix- suffix- Returns:
- list of files
-
listFilesByPrefix
public File[] listFilesByPrefix(String fileFolder, String prefix)
Description copied from interface:FSFactorylist file by prefix- Specified by:
listFilesByPrefixin interfaceFSFactory- Parameters:
fileFolder- file folderprefix- prefix- Returns:
- list of files
-
deleteIfExists
public boolean deleteIfExists(File file) throws IOException
Description copied from interface:FSFactorydelete the file if it exists- Specified by:
deleteIfExistsin interfaceFSFactory- Parameters:
file- local file or HDFS file- Throws:
IOException
-
deleteDirectory
public void deleteDirectory(String dir) throws IOException
Description copied from interface:FSFactoryForce delete the directory- Specified by:
deleteDirectoryin interfaceFSFactory- Throws:
IOException
-
-