net.netheos.pcsapi.models
Class CUploadRequest

java.lang.Object
  extended by net.netheos.pcsapi.models.CUploadRequest

public class CUploadRequest
extends Object

Class that parametrizes an upload request: path + bytes source


Constructor Summary
CUploadRequest(CPath path, ByteSource byteSource)
           
 
Method Summary
 ByteSource getByteSource()
          If no progress listener has been set, return the byte source set in constructor, otherwise decorate it for progress.
 String getContentType()
          Get the file content type
 CMetadata getMetadata()
          Get the metadata setted to the file to upload
 CPath getPath()
          Get the destination file path where the data will be uploaded
 CUploadRequest setContentType(String contentType)
          Set the content type
 CUploadRequest setMetadata(CMetadata metadata)
          Set the metadata to the file to upload
 CUploadRequest setProgressListener(ProgressListener pl)
          Defines an object that will be notified during upload.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CUploadRequest

public CUploadRequest(CPath path,
                      ByteSource byteSource)
Method Detail

getPath

public CPath getPath()
Get the destination file path where the data will be uploaded

Returns:
The file path

getContentType

public String getContentType()
Get the file content type

Returns:
The content type or null if not defined

setContentType

public CUploadRequest setContentType(String contentType)
Set the content type

Parameters:
contentType - The content type (ie. "image/jpeg")
Returns:
The upload request

getMetadata

public CMetadata getMetadata()
Get the metadata setted to the file to upload

Returns:
The metadata or null if not defined

setMetadata

public CUploadRequest setMetadata(CMetadata metadata)
Set the metadata to the file to upload

Parameters:
metadata - The metadata to use
Returns:
The upload request

setProgressListener

public CUploadRequest setProgressListener(ProgressListener pl)
Defines an object that will be notified during upload.

Parameters:
pl - progress listener
Returns:
The upload request

getByteSource

public ByteSource getByteSource()
If no progress listener has been set, return the byte source set in constructor, otherwise decorate it for progress.

Returns:
the byte source to be used for upload operation.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.