|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kallasoft.smugmug.api.json.AbstractMethod
com.kallasoft.smugmug.api.json.v1_2_0.images.UploadHTTPPut
com.kallasoft.smugmug.api.json.v1_2_1.images.UploadHTTPPut
public class UploadHTTPPut
This class is a convenience class extending the base
UploadHTTPPut
implementation.
UploadHTTPPut| Nested Class Summary | |
|---|---|
class |
UploadHTTPPut.UploadHTTPPutResponse
This class is a convenience class extending the base UploadHTTPPut.UploadHTTPPutResponse
implementation. |
| Field Summary |
|---|
| Fields inherited from class com.kallasoft.smugmug.api.json.v1_2_0.images.UploadHTTPPut |
|---|
HTTP_HEADERS |
| Constructor Summary | |
|---|---|
UploadHTTPPut()
Construct a new method instance that can be executed. |
|
UploadHTTPPut(String methodName,
String[] arguments)
Construct a new method instance that can be executed with the given arguments. |
|
| Method Summary | |
|---|---|
AbstractResponse |
execute(String url,
String[] argumentValues)
Unimplemented method, throws UnsupportedOperationException. |
UploadHTTPPut.UploadHTTPPutResponse |
execute(String url,
String[] httpHeaderValues,
byte[] imageData)
Used to perform a Binary-only upload using HTTP PUT. |
UploadHTTPPut.UploadHTTPPutResponse |
execute(String url,
String sessionID,
Integer albumID,
Integer imageID,
String fileName,
InputStream inputStream)
Convenience method that delegates to UploadHTTPPut.execute(String, String, Integer, Integer, String, InputStream, String, String, Double, Double, Double). |
UploadHTTPPut.UploadHTTPPutResponse |
execute(String url,
String sessionID,
Integer albumID,
Integer imageID,
String fileName,
InputStream inputStream,
String caption,
String keywords,
Double latitude,
Double longitude,
Double altitude)
Convenience method used to take a InputStream and load the bytes
of the image file before calling
UploadHTTPPut.execute(String, String[], byte[]). |
| Methods inherited from class com.kallasoft.smugmug.api.json.v1_2_0.images.UploadHTTPPut |
|---|
executeUploadImpl, prepareUploadArgumentValues, setupHTTPHeaders |
| Methods inherited from class com.kallasoft.smugmug.api.json.AbstractMethod |
|---|
executeImpl, getArguments, getMethodName, setupPostParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UploadHTTPPut()
public UploadHTTPPut(String methodName,
String[] arguments)
methodName - The name of the SmugMug JSON API method that this
Method represents.arguments - The names of the arguments that this method accepts.| Method Detail |
|---|
public AbstractResponse execute(String url,
String[] argumentValues)
throws UnsupportedOperationException
UploadHTTPPutUnsupportedOperationException.
This method is implemented to throw an exception because the underlying
implementation from AbstractMethod is implemented to do textual
communication only, but this method implements it's own Binary-Only
upload method using HTTP PUT.
Use any of the other execute methods to perform a binary
upload to SmugMug.
execute in interface Methodexecute in class UploadHTTPPuturl - The URL of the SmugMug server to communicate with.argumentValues - The argument values to pass to this method.
UnsupportedOperationException - if it is called. Please use one of the other
execute methods to perform an upload.UploadHTTPPut.execute(String, String[], byte[]),
UploadHTTPPut.execute(String, String, Integer, Integer, String, InputStream),
UploadHTTPPut.execute(String, String, Integer, Integer, String, InputStream,
String, String, Double, Double, Double)
public UploadHTTPPut.UploadHTTPPutResponse execute(String url,
String[] httpHeaderValues,
byte[] imageData)
throws IllegalArgumentException,
NetworkException,
RuntimeException
UploadHTTPPutOnly one argument of either "X-Smug-AlbumID" (httpHeaderValues[5]) or "X-Smug-ImageID" (httpHeaderValues[6]) can be specified. If "X-Smug-AlbumID" is specified this operation will be a new-image-upload operation but if "X-Smug-ImageID" is specified the operation will be an image-replacement operation.
NOTE: This method forcibly sets the X-Smug-ResponseType header value to "JSON" and the X-Smug-Version header value to "1.2.0". Sub-classes are encouraged to set their own values, but this class of the API only supports these values.
execute in class UploadHTTPPuturl - The URL of the SmugMug server to communicate with. This
usually must be equal to the the SmugMug Upload URL, otherwise
the image will not be processed.httpHeaderValues - The HTTP header values that will be sent along with this
upload. These values represent all the upload arguments to be
associated with the uploaded image, see UploadHTTPPut.HTTP_HEADERS.imageData - A byte array containing the actual image data that will be
uploaded.
IllegalArgumentException - if url is null or empty.
NetworkException - if anything other than a HTTP status code of 200 (OK) is
returned from the server. This is not the same as a network
exception and normally represents a failure on the SmugMug
server side.
RuntimeException - if the given fileName (httpHeaderValues[7]), represented by
the X-Smug-FileName header value, cannot be property URL
encoded before being sent to SmugMug in the upload operation.UploadHTTPPut.HTTP_HEADERS
public UploadHTTPPut.UploadHTTPPutResponse execute(String url,
String sessionID,
Integer albumID,
Integer imageID,
String fileName,
InputStream inputStream)
UploadHTTPPutUploadHTTPPut.execute(String, String, Integer, Integer, String, InputStream, String, String, Double, Double, Double).
Only one argument of either "X-Smug-AlbumID" (httpHeaderValues[5]) or "X-Smug-ImageID" (httpHeaderValues[6]) can be specified. If "X-Smug-AlbumID" is specified this operation will be a new-image-upload operation but if "X-Smug-ImageID" is specified the operation will be an image-replacement operation.
NOTE: This method forcibly sets the X-Smug-ResponseType header value to "JSON" and the X-Smug-Version header value to "1.2.0". Sub-classes are encouraged to set their own values, but this class of the API only supports these values.
execute in class UploadHTTPPuturl - The URL of the SmugMug server to communicate with. This
usually must be equal to the the SmugMug Upload URL, otherwise
the image will not be processed.sessionID - The logged in SessionID that represents the user's session.albumID - The ID of the album to upload the image into. Only albumID or
imageID can be specified, but not both.imageID - The ID of the image to replace. Only albumID or imageID can be
specified, but not both.fileName - The name of the file whose stream will be read for data and
uploaded.inputStream - The InputStream to load the image data from and upload
to SmugMug.
UploadHTTPPut.execute(String, String[], byte[]),
UploadHTTPPut.HTTP_HEADERS
public UploadHTTPPut.UploadHTTPPutResponse execute(String url,
String sessionID,
Integer albumID,
Integer imageID,
String fileName,
InputStream inputStream,
String caption,
String keywords,
Double latitude,
Double longitude,
Double altitude)
throws IllegalArgumentException,
RuntimeException
UploadHTTPPutInputStream and load the bytes
of the image file before calling
UploadHTTPPut.execute(String, String[], byte[]).
Only one argument of either "X-Smug-AlbumID" (httpHeaderValues[5]) or "X-Smug-ImageID" (httpHeaderValues[6]) can be specified. If "X-Smug-AlbumID" is specified this operation will be a new-image-upload operation but if "X-Smug-ImageID" is specified the operation will be an image-replacement operation.
This method will automatically set the "Content-Length" and "Content-MD5" headers after loading the image and computing the values on the fly.
NOTE: This method forcibly sets the X-Smug-ResponseType header value to "JSON" and the X-Smug-Version header value to "1.2.0". Sub-classes are encouraged to set their own values, but this class of the API only supports these values.
execute in class UploadHTTPPuturl - The URL of the SmugMug server to communicate with. This
usually must be equal to the the SmugMug Upload URL, otherwise
the image will not be processed.sessionID - The logged in SessionID that represents the user's session.albumID - The ID of the album to upload the image into. Only albumID or
imageID can be specified, but not both.imageID - The ID of the image to replace. Only albumID or imageID can be
specified, but not both.fileName - The name of the file whose stream will be read for data and
uploaded.inputStream - The InputStream to load and upload to SmugMug.caption - A caption for the image.keywords - The keywords assigned to the image.latitude - The latitude used to geocode the image.longitude - The longitude used to geocode the image.altitude - The altitude (in meters) used to geocode the image.
IllegalArgumentException - if inputStream is null
RuntimeException - if the bytes of the image could not be loaded.UploadHTTPPut.execute(String, String[], byte[]),
UploadHTTPPut.HTTP_HEADERS
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||