com.groupdocs.metadata

Interfaces

Classes

Exceptions

com.groupdocs.metadata

Class PreviewFactory



  • public class PreviewFactory
    extends Object

    Provides a set of methods for creating instances of appropriate preview handlers.

    • Constructor Detail

      • PreviewFactory

        public PreviewFactory()
    • Method Detail

      • load

        public static PreviewHandler load(InputStream stream)

        Creates an appropriate preview handler from the specified stream.

        Parameters:
        stream - The stream containing the document to preview.
        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.
      • load

        public static PreviewHandler load(String filePath)

        Creates an appropriate preview handler from the specified file.

        Parameters:
        filePath - The file containing the document to preview.
        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.
      • load

        public static <T extends PreviewHandler> T load(String filePath,
                                        String password,
                                        Class<T> handlerType)

        Creates an appropriate preview handler from the specified file.

        Parameters:
        filePath - The file containing the document to preview.
        password - The password required to open the document.
        handlerType - The exact type of the preview handler to create.

        T: The exact type of the preview handler to create.

        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.
      • load

        public static <T extends PreviewHandler> T load(String filePath,
                                        Class<T> handlerType)

        Creates an appropriate preview handler from the specified file.

        Parameters:
        filePath - The file containing the document to preview.
        handlerType - The exact type of the preview handler to create.

        T: The exact type of the preview handler to create.

        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.
      • load

        public static <T extends PreviewHandler> T load(InputStream stream,
                                        String password,
                                        Class<T> handlerType)

        Creates an appropriate preview handler from the specified stream.

        Parameters:
        stream - The stream containing the document to preview.
        password - The password required to open the document.
        handlerType - The exact type of the preview handler to create.

        T: The exact type of the preview handler to create.

        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.
      • load

        public static <T extends PreviewHandler> T load(InputStream stream,
                                        Class<T> handlerType)

        Creates an appropriate preview handler from the specified stream.

        Parameters:
        stream - The stream containing the document to preview.
        handlerType - The exact type of the preview handler to create.

        T: The exact type of the preview handler to create.

        Returns:
        An instance of the appropriate descendant of the PreviewHandler class.