Class HDFSFactory

    • Constructor Detail

      • HDFSFactory

        public HDFSFactory()
    • Method Detail

      • getFileWithParent

        public File getFileWithParent​(String pathname)
        Description copied from interface: FSFactory
        get file with parent
        Specified by:
        getFileWithParent in interface FSFactory
        Parameters:
        pathname - pathname
        Returns:
        file with parent
      • getFile

        public File getFile​(String pathname)
        Description copied from interface: FSFactory
        get file
        Specified by:
        getFile in interface FSFactory
        Parameters:
        pathname - pathname
        Returns:
        file
      • getFile

        public File getFile​(String parent,
                            String child)
        Description copied from interface: FSFactory
        get file
        Specified by:
        getFile in interface FSFactory
        Parameters:
        parent - parent file path
        child - child file path
        Returns:
        file
      • getFile

        public File getFile​(File parent,
                            String child)
        Description copied from interface: FSFactory
        get file
        Specified by:
        getFile in interface FSFactory
        Parameters:
        parent - parent file
        child - child file path
        Returns:
        file
      • getFile

        public File getFile​(URI uri)
        Description copied from interface: FSFactory
        get file by uri
        Specified by:
        getFile in interface FSFactory
        Parameters:
        uri - uri
        Returns:
        file
      • getBufferedWriter

        public BufferedWriter getBufferedWriter​(String filePath,
                                                boolean append)
        Description copied from interface: FSFactory
        get buffered reader
        Specified by:
        getBufferedWriter in interface FSFactory
        Parameters:
        filePath - file path
        append - whether is append
        Returns:
        buffered reader
      • listFilesBySuffix

        public File[] listFilesBySuffix​(String fileFolder,
                                        String suffix)
        Description copied from interface: FSFactory
        list file by suffix
        Specified by:
        listFilesBySuffix in interface FSFactory
        Parameters:
        fileFolder - file folder
        suffix - suffix
        Returns:
        list of files
      • listFilesByPrefix

        public File[] listFilesByPrefix​(String fileFolder,
                                        String prefix)
        Description copied from interface: FSFactory
        list file by prefix
        Specified by:
        listFilesByPrefix in interface FSFactory
        Parameters:
        fileFolder - file folder
        prefix - prefix
        Returns:
        list of files
      • deleteIfExists

        public boolean deleteIfExists​(File file)
        Description copied from interface: FSFactory
        delete the file if it exists
        Specified by:
        deleteIfExists in interface FSFactory
        Parameters:
        file - local file or HDFS file