com.groupdocs.viewer.handlers.cache
Class ImageCacheDataHandler

java.lang.Object
  extended by com.groupdocs.viewer.handlers.cache.ImageCacheDataHandler
All Implemented Interfaces:
CacheDataHandler

public abstract class ImageCacheDataHandler
extends Object
implements CacheDataHandler

Author:
Alex Bobkov

Constructor Summary
ImageCacheDataHandler()
           
 
Method Summary
 OutputStream getHtmlResourceSaveStream(GroupDocsFileDescription fileDescription, Integer page, String resourceName)
          Get output stream for saving temp HTML resource file
 InputStream getHtmlResourceStream(GroupDocsFileDescription fileDescription, Integer page, String resourceName)
          Get input stream of temp HTML resource file
 OutputStream getHtmlSaveStream(GroupDocsFileDescription fileDescription, Integer page)
          Get output stream for saving temp HTML file
 InputStream getHtmlStream(GroupDocsFileDescription fileDescription, Integer page)
          Get input stream of temp HTML file
abstract  OutputStream getImageSaveStream(GroupDocsFileDescription fileDescription, int page, int width)
          Get output stream for saving temp image file
abstract  InputStream getImageStream(GroupDocsFileDescription fileDescription, int page, int width)
          Get input stream of temp image file
abstract  String getJsContent(GroupDocsFileDescription fileDescription)
          Get content of temp.js file
abstract  OutputStream getPdfSaveStream(GroupDocsFileDescription fileDescription)
          Get output stream for saving temp pdf file
abstract  InputStream getPdfStream(GroupDocsFileDescription fileDescription)
          Get input stream of temp pdf file
 boolean htmlExists(GroupDocsFileDescription fileDescription, Integer page)
          Check if temp HTML file exists
 boolean htmlResourceExists(GroupDocsFileDescription fileDescription, Integer page, String resourceName)
          Check if temp HTML resource file exists
abstract  boolean imageExists(GroupDocsFileDescription fileDescription, int page, int width)
          Check if temp image file exists
abstract  boolean jsExists(GroupDocsFileDescription fileDescription)
          Check if temp.js file is exists
abstract  boolean pdfExists(GroupDocsFileDescription fileDescription)
          Check if temp pdf file exists
abstract  void saveJsContent(String content, GroupDocsFileDescription fileDescription)
          Save content
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageCacheDataHandler

public ImageCacheDataHandler()
Method Detail

imageExists

public abstract boolean imageExists(GroupDocsFileDescription fileDescription,
                                    int page,
                                    int width)
                             throws Exception
Description copied from interface: CacheDataHandler
Check if temp image file exists

Specified by:
imageExists in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
width - image width
Returns:
true if temp file already exists
Throws:
Exception

getImageStream

public abstract InputStream getImageStream(GroupDocsFileDescription fileDescription,
                                           int page,
                                           int width)
                                    throws Exception
Description copied from interface: CacheDataHandler
Get input stream of temp image file

Specified by:
getImageStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
width - image width
Returns:
stream image input steam
Throws:
Exception

getImageSaveStream

public abstract OutputStream getImageSaveStream(GroupDocsFileDescription fileDescription,
                                                int page,
                                                int width)
                                         throws Exception
Description copied from interface: CacheDataHandler
Get output stream for saving temp image file

Specified by:
getImageSaveStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
width - image width
Returns:
stream output stream to where image will be saved
Throws:
Exception

pdfExists

public abstract boolean pdfExists(GroupDocsFileDescription fileDescription)
                           throws Exception
Description copied from interface: CacheDataHandler
Check if temp pdf file exists

Specified by:
pdfExists in interface CacheDataHandler
Parameters:
fileDescription - file description object
Returns:
true if file exists
Throws:
Exception

getPdfStream

public abstract InputStream getPdfStream(GroupDocsFileDescription fileDescription)
                                  throws Exception
Description copied from interface: CacheDataHandler
Get input stream of temp pdf file

Specified by:
getPdfStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
Returns:
stream pdf input stream
Throws:
Exception

getPdfSaveStream

public abstract OutputStream getPdfSaveStream(GroupDocsFileDescription fileDescription)
                                       throws Exception
Description copied from interface: CacheDataHandler
Get output stream for saving temp pdf file

Specified by:
getPdfSaveStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
Returns:
stream output stream to where pdf file will be saved
Throws:
Exception

jsExists

public abstract boolean jsExists(GroupDocsFileDescription fileDescription)
                          throws Exception
Description copied from interface: CacheDataHandler
Check if temp.js file is exists

Specified by:
jsExists in interface CacheDataHandler
Parameters:
fileDescription - file description object
Returns:
true if temp file exists
Throws:
Exception

getJsContent

public abstract String getJsContent(GroupDocsFileDescription fileDescription)
                             throws Exception
Description copied from interface: CacheDataHandler
Get content of temp.js file

Specified by:
getJsContent in interface CacheDataHandler
Parameters:
fileDescription - file description object
Returns:
content of temp.js file
Throws:
Exception

saveJsContent

public abstract void saveJsContent(String content,
                                   GroupDocsFileDescription fileDescription)
                            throws Exception
Description copied from interface: CacheDataHandler
Save content

Specified by:
saveJsContent in interface CacheDataHandler
Parameters:
content - content of temp.js file
fileDescription - file description object
Throws:
Exception

htmlExists

public boolean htmlExists(GroupDocsFileDescription fileDescription,
                          Integer page)
                   throws Exception
Description copied from interface: CacheDataHandler
Check if temp HTML file exists

Specified by:
htmlExists in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
true if file exists
Throws:
Exception

getHtmlStream

public InputStream getHtmlStream(GroupDocsFileDescription fileDescription,
                                 Integer page)
                          throws Exception
Description copied from interface: CacheDataHandler
Get input stream of temp HTML file

Specified by:
getHtmlStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
stream
Throws:
Exception

getHtmlSaveStream

public OutputStream getHtmlSaveStream(GroupDocsFileDescription fileDescription,
                                      Integer page)
                               throws Exception
Description copied from interface: CacheDataHandler
Get output stream for saving temp HTML file

Specified by:
getHtmlSaveStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
stream
Throws:
Exception

htmlResourceExists

public boolean htmlResourceExists(GroupDocsFileDescription fileDescription,
                                  Integer page,
                                  String resourceName)
                           throws Exception
Description copied from interface: CacheDataHandler
Check if temp HTML resource file exists

Specified by:
htmlResourceExists in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
true if file exists
Throws:
Exception

getHtmlResourceStream

public InputStream getHtmlResourceStream(GroupDocsFileDescription fileDescription,
                                         Integer page,
                                         String resourceName)
                                  throws Exception
Description copied from interface: CacheDataHandler
Get input stream of temp HTML resource file

Specified by:
getHtmlResourceStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
stream
Throws:
Exception

getHtmlResourceSaveStream

public OutputStream getHtmlResourceSaveStream(GroupDocsFileDescription fileDescription,
                                              Integer page,
                                              String resourceName)
                                       throws Exception
Description copied from interface: CacheDataHandler
Get output stream for saving temp HTML resource file

Specified by:
getHtmlResourceSaveStream in interface CacheDataHandler
Parameters:
fileDescription - file description object
page - page number
Returns:
stream
Throws:
Exception


Copyright © 2015. All rights reserved.