com.groupdocs.viewer.handlers.input
Class InputDataHandler

java.lang.Object
  extended by com.groupdocs.viewer.handlers.input.InputDataHandler
Direct Known Subclasses:
AzureInputDataHandler, LocalInputDataHandler

public abstract class InputDataHandler
extends Object

Data source interface
Used to define other data sources such as from databases or virtual devices

Author:
Aleksey Permyakov

Constructor Summary
InputDataHandler()
           
 
Method Summary
abstract  InputStream getFile(String guid)
          Get file
abstract  File[] getFileList(String directory)
          Get files list
abstract  FileType getFileType(String guid)
          Get file type
 boolean getImage(String guid, String imageSrc, OutputStream outputStream)
          Get external image (for html and some files with images)
static InputDataHandler getInputDataHandler()
          Get InputDataHandler
static InputDataHandler getInstance()
          Get InputDataHandler instance
abstract  String saveFile(InputStream inputStream, String fileName, Integer timeToLive)
          Save file
static void setInputDataHandler(InputDataHandler inputDataHandler)
          Set InputDataHandler instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputDataHandler

public InputDataHandler()
Method Detail

getInstance

public static InputDataHandler getInstance()
Get InputDataHandler instance

Returns:
InputDataHandler instance

setInputDataHandler

public static void setInputDataHandler(InputDataHandler inputDataHandler)
Set InputDataHandler instance

Parameters:
inputDataHandler - InputDataHandler instance

getInputDataHandler

public static InputDataHandler getInputDataHandler()
Get InputDataHandler

Returns:
InputDataHandler

getFileList

public abstract File[] getFileList(String directory)
Get files list

Parameters:
directory - Files location directory
Returns:
Files map, list or array

getFile

public abstract InputStream getFile(String guid)
Get file

Parameters:
guid - File id or file path
Returns:
InputStream of the file

getImage

public boolean getImage(String guid,
                        String imageSrc,
                        OutputStream outputStream)
Get external image (for html and some files with images)

Parameters:
guid - file GUID
imageSrc - value of src attribute from img tag in html file
outputStream - stream to write image data
Returns:

getFileType

public abstract FileType getFileType(String guid)
Get file type

Parameters:
guid - File id or file path
Returns:
FileType of the file

saveFile

public abstract String saveFile(InputStream inputStream,
                                String fileName,
                                Integer timeToLive)
Save file

Parameters:
inputStream -
fileName -
timeToLive -
Returns:


Copyright © 2014. All rights reserved.