Interface FSFactory

    • Method Detail

      • getFileWithParent

        File getFileWithParent​(String pathname)
        get file with parent
        Parameters:
        pathname - pathname
        Returns:
        file with parent
      • getFile

        File getFile​(String pathname)
        get file
        Parameters:
        pathname - pathname
        Returns:
        file
      • getFile

        File getFile​(String parent,
                     String child)
        get file
        Parameters:
        parent - parent file path
        child - child file path
        Returns:
        file
      • getFile

        File getFile​(File parent,
                     String child)
        get file
        Parameters:
        parent - parent file
        child - child file path
        Returns:
        file
      • getFile

        File getFile​(URI uri)
        get file by uri
        Parameters:
        uri - uri
        Returns:
        file
      • getBufferedReader

        BufferedReader getBufferedReader​(String filePath)
        get buffered reader
        Parameters:
        filePath - file path
        Returns:
        buffered reader
      • getBufferedWriter

        BufferedWriter getBufferedWriter​(String filePath,
                                         boolean append)
        get buffered reader
        Parameters:
        filePath - file path
        append - whether is append
        Returns:
        buffered reader
      • getBufferedInputStream

        BufferedInputStream getBufferedInputStream​(String filePath)
        get input stream
        Parameters:
        filePath - file path
        Returns:
        input stream
      • getBufferedOutputStream

        BufferedOutputStream getBufferedOutputStream​(String filePath)
        get output stream
        Parameters:
        filePath - file path
        Returns:
        output stream
      • moveFile

        void moveFile​(File srcFile,
                      File destFile)
               throws IOException
        move file
        Parameters:
        srcFile - src file
        destFile - dest file
        Throws:
        IOException
      • copyFile

        void copyFile​(File srcFile,
                      File destFile)
               throws IOException
        copy file
        Parameters:
        srcFile - src file
        destFile - dest file
        Throws:
        IOException
      • listFilesBySuffix

        File[] listFilesBySuffix​(String fileFolder,
                                 String suffix)
        list file by suffix
        Parameters:
        fileFolder - file folder
        suffix - suffix
        Returns:
        list of files
      • listFilesByPrefix

        File[] listFilesByPrefix​(String fileFolder,
                                 String prefix)
        list file by prefix
        Parameters:
        fileFolder - file folder
        prefix - prefix
        Returns:
        list of files
      • deleteIfExists

        boolean deleteIfExists​(File file)
                        throws IOException
        delete the file if it exists
        Parameters:
        file - local file or HDFS file
        Throws:
        IOException