com.groupdocs.viewer.handlers.cache
Class HtmlCacheDataHandler

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

public abstract class HtmlCacheDataHandler
extends Object
implements CacheDataHandler

Author:
Alex Bobkov

Constructor Summary
HtmlCacheDataHandler()
           
 
Method Summary
abstract  OutputStream getHtmlResourceSaveStream(GroupDocsFileDescription fileDescription, Integer page, String resourceName)
          Get output stream for saving temp HTML resource file
abstract  InputStream getHtmlResourceStream(GroupDocsFileDescription fileDescription, Integer page, String resourceName)
          Get input stream of temp HTML resource file
abstract  OutputStream getHtmlSaveStream(GroupDocsFileDescription fileDescription, Integer page)
          Get output stream for saving temp HTML file
abstract  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
 String getJsContent(GroupDocsFileDescription fileDescription)
          Get content of temp.js file
 OutputStream getPdfSaveStream(GroupDocsFileDescription fileDescription)
          Get output stream for saving temp pdf file
 InputStream getPdfStream(GroupDocsFileDescription fileDescription)
          Get input stream of temp pdf file
abstract  boolean htmlExists(GroupDocsFileDescription fileDescription, Integer page)
          Check if temp HTML file exists
abstract  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
 boolean jsExists(GroupDocsFileDescription fileDescription)
          Check if temp.js file is exists
 boolean pdfExists(GroupDocsFileDescription fileDescription)
          Check if temp pdf file exists
 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

HtmlCacheDataHandler

public HtmlCacheDataHandler()
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 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 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 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 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 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 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract 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.