com.aetrion.flickr.uploader
Class Uploader

java.lang.Object
  extended by com.aetrion.flickr.uploader.Uploader

public class Uploader
extends java.lang.Object

Upload a photo.

Setting UploadMetaData.setAsync(boolean) you can switch between synchronous and asynchronous uploads.

Synchronous uploads return the photoId, whilst asynchronous uploads return a ticketId.

TicketId's can be tracked with UploadInterface.checkTickets(Set) for completion.

Version:
$Id: Uploader.java,v 1.11 2008/02/04 22:16:29 x-mago Exp $
Author:
Anthony Eden

Constructor Summary
Uploader(java.lang.String apiKey, java.lang.String sharedSecret)
          Construct an Uploader.
 
Method Summary
 java.lang.String upload(byte[] data, UploadMetaData metaData)
          Upload a photo from a byte-array.
 java.lang.String upload(java.io.InputStream in, UploadMetaData metaData)
          Upload a photo from an InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Uploader

public Uploader(java.lang.String apiKey,
                java.lang.String sharedSecret)
Construct an Uploader.

Parameters:
apiKey - The API key
Method Detail

upload

public java.lang.String upload(byte[] data,
                               UploadMetaData metaData)
                        throws FlickrException,
                               java.io.IOException,
                               org.xml.sax.SAXException
Upload a photo from a byte-array.

Parameters:
data - The photo data as a byte array
metaData - The meta data
Returns:
photoId or ticketId
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException

upload

public java.lang.String upload(java.io.InputStream in,
                               UploadMetaData metaData)
                        throws java.io.IOException,
                               FlickrException,
                               org.xml.sax.SAXException
Upload a photo from an InputStream.

Parameters:
in -
metaData -
Returns:
photoId or ticketId
Throws:
java.io.IOException
FlickrException
org.xml.sax.SAXException


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.