Class AbstractContentHandler

    • Constructor Detail

      • AbstractContentHandler

        public AbstractContentHandler()
    • Method Detail

      • checkFile

        protected String checkFile​(File file)
        Performs some checks on the file.
        Parameters:
        file - the file to check
        Returns:
        null if check passed, otherwise error message
      • reusePreview

        public PreviewPanel reusePreview​(File file,
                                         PreviewPanel lastPreview)
        Reuses the last preview, if possible.
        Default implementation just creates a new preview.
        Specified by:
        reusePreview in interface ContentHandler
        Parameters:
        file - the file to create the view for
        Returns:
        the preview
      • createPreview

        public abstract PreviewPanel createPreview​(File file)
        Creates the actual preview.
        Specified by:
        createPreview in interface ContentHandler
        Parameters:
        file - the file to create the view for
        Returns:
        the preview
      • getHandlers

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

        protected static Hashtable<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