Class AbstractArchiveHandler

    • Field Detail

      • m_Archive

        protected PlaceholderFile m_Archive
        the archive to extract the files from.
      • m_Relation

        protected static Map<String,​List<Class>> m_Relation
        the extenstion archive handlers relation.
    • Constructor Detail

      • AbstractArchiveHandler

        public AbstractArchiveHandler()
    • Method Detail

      • archiveTipText

        public String archiveTipText()
        Returns the tip text for this property.
        Specified by:
        archiveTipText in interface ArchiveHandler
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • checkArchive

        protected void checkArchive()
        Performs some checks on the archive.
      • listFiles

        protected abstract String[] listFiles()
        Performs actual listing of files.
        Returns:
        the stored files
      • doExtract

        protected abstract boolean doExtract​(String archiveFile,
                                             File outFile)
        Extracts the specified file and saves it locally.
        Parameters:
        archiveFile - the file in the archive to extract
        outFile - the local file to store the content in
        Returns:
        true if successfully extracted
        See Also:
        listFiles()
      • extract

        public boolean extract​(String archiveFile,
                               File outFile)
        Extracts the specified file and saves it locally.
        Specified by:
        extract in interface ArchiveHandler
        Parameters:
        archiveFile - the file in the archive to extract
        outFile - the local file to store the content in
        Returns:
        true if successfully extracted
        See Also:
        listFiles()
      • getHandlers

        public static String[] getHandlers()
        Returns a list with classnames of handlers.
        Returns:
        the handler classnames
      • getRelation

        protected static Map<String,​List<Class>> getRelation()
        Returns the extension/handlers relation.
        Returns:
        the relation
      • hasHandler

        public static boolean hasHandler​(File file)
        Checks whether the specified file is an archive that can be managed.
        Parameters:
        file - the file to check
        Returns:
        true if the file represents a managed archive
      • hasHandler

        public static boolean hasHandler​(String filename)
        Checks whether the specified file is an archive that can be managed.
        Parameters:
        filename - the file to check
        Returns:
        true if the file represents a managed archive
      • getHandlersForFile

        public static List<Class> getHandlersForFile​(File file)
        Returns the handlers registered for the extension of the specified file.
        Parameters:
        file - the file to get the handlers for
        Returns:
        the handlers, null if none available
      • getHandlersForFile

        public static List<Class> getHandlersForFile​(String filename)
        Returns the handlers registered for the extension of the specified file.
        Parameters:
        filename - the file to get the handlers for
        Returns:
        the handlers, null if none available