FilePreviewer (gCube Share Updates Portlet 1.7.0-3.7.0 API)
Date: 2015-05-19

org.gcube.portlets.user.shareupdates.server

## Class FilePreviewer

- java.lang.Object
- - org.gcube.portlets.user.shareupdates.server.FilePreviewer

-     public class FilePreviewer
      extends Object

  Author:
    Massimiliano Assante, ISTI-CNR Parse files and returns an image preview plus description

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilePreviewer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static LinkPreview` | `getImagePreview(String fileName, String path2Image, String httpUrl, String mimeType)`
    `protected static String` | `getMimeType(File file, String filenameWithExtension)`
    `protected static LinkPreview` | `getPdfPreview(String fileName, String path2Pdf, String httpUrl, String mimeType)`
    `protected static LinkPreview` | `getUnhandledTypePreview(String fileName, String path2Pdf, String httpUrl, String mimeType)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FilePreviewer

          public FilePreviewer()

  - ### Method Detail

    - #### getPdfPreview

          protected static LinkPreview getPdfPreview(String fileName,
                                  String path2Pdf,
                                  String httpUrl,
                                  String mimeType)
                                              throws Exception

      Parameters:
        `fileName` - thename of the file
        `path2Pdf` - the path of the pdf file
        `httpUrl` - the http url where the file is reachable at
      Returns:
      Throws:
        `Exception`

    - #### getImagePreview

          protected static LinkPreview getImagePreview(String fileName,
                                    String path2Image,
                                    String httpUrl,
                                    String mimeType)

      Parameters:
        `fileName` - thename of the file
        `path2Image` - the path of the image file
        `httpUrl` - the http url where the file is reachable at
      Returns:
      Throws:
        `Exception`

    - #### getUnhandledTypePreview

          protected static LinkPreview getUnhandledTypePreview(String fileName,
                                            String path2Pdf,
                                            String httpUrl,
                                            String mimeType)
                                                        throws Exception

      Parameters:
        `fileName` - thename of the file
        `path2Pdf` - the path of the pdf file
        `httpUrl` - the http url where the file is reachable at
      Returns:
      Throws:
        `Exception`

    - #### getMimeType

          protected static String getMimeType(File file,
                           String filenameWithExtension)
                                       throws IOException

      Parameters:
        `file` -
      Returns:
      Throws:
        `IOException`
        `MagicParseException`
        `MagicMatchNotFoundException`
        `MagicException`

Copyright © 2015. All Rights Reserved.