com.groupdocs.viewer.handlers.input
Class AmazonS3InputDataHandler

java.lang.Object
  extended by com.groupdocs.viewer.handlers.input.InputDataHandler
      extended by com.groupdocs.viewer.handlers.input.AmazonS3InputDataHandler

public class AmazonS3InputDataHandler
extends InputDataHandler

Amazon S3 Input Data Handler

Author:
Alex Bobkov

Constructor Summary
AmazonS3InputDataHandler(String accessKey, String secretKey, String bucketName)
          Constructor
AmazonS3InputDataHandler(String accessKey, String secretKey, String bucketName, String uploadPath)
          Constructor
 
Method Summary
 InputStream getFile(String guid)
          Get file
 GroupDocsFileDescription getFileDescription(String guid)
          Get file description
 List<GroupDocsFileDescription> getFileDescriptionList(String directory)
          Get file description list
 String saveFile(InputStream inputStream, String fileName, Integer timeToLive, String encryptedKey)
          Save file
 
Methods inherited from class com.groupdocs.viewer.handlers.input.InputDataHandler
getImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AmazonS3InputDataHandler

public AmazonS3InputDataHandler(String accessKey,
                                String secretKey,
                                String bucketName)
Constructor

Parameters:
accessKey - AWS access key
secretKey - AWS secret key
bucketName - bucket name

AmazonS3InputDataHandler

public AmazonS3InputDataHandler(String accessKey,
                                String secretKey,
                                String bucketName,
                                String uploadPath)
Constructor

Parameters:
accessKey - AWS access key
secretKey - AWS secret key
bucketName - bucket name
uploadPath - upload path
ex: somefolder/uploads/
pass null or empty String for root directory
Method Detail

getFileDescriptionList

public List<GroupDocsFileDescription> getFileDescriptionList(String directory)
Description copied from class: InputDataHandler
Get file description list

Specified by:
getFileDescriptionList in class InputDataHandler
Parameters:
directory - files location directory
Returns:
list of file descriptions

getFileDescription

public GroupDocsFileDescription getFileDescription(String guid)
                                            throws Exception
Description copied from class: InputDataHandler
Get file description

Specified by:
getFileDescription in class InputDataHandler
Parameters:
guid - file id
Returns:
Throws:
Exception

getFile

public InputStream getFile(String guid)
Description copied from class: InputDataHandler
Get file

Specified by:
getFile in class InputDataHandler
Parameters:
guid - file id
Returns:
InputStream of the file

saveFile

public String saveFile(InputStream inputStream,
                       String fileName,
                       Integer timeToLive,
                       String encryptedKey)
Description copied from class: InputDataHandler
Save file

Specified by:
saveFile in class InputDataHandler
Parameters:
inputStream - Input stream of object to be saved/uploaded
fileName - file name
timeToLive - TTL, 0 - unlimited
encryptedKey - encryption key
Returns:
token Id


Copyright © 2015. All rights reserved.