|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.commsen.jwebthumb.WebThumbService
public class WebThumbService
This class provides convenient methods for webthumb's "request", "fetch" and "credits" API calls.
It does not support "status" call. Please use "notifications" instead by extending
WebThumbNotificationServlet
and implementing
WebThumbNotificationServlet.processThumb(String, String)
method.
For more details about webthumb's API please visit http://webthumb.bluga.net/apidoc
http://webthumb.bluga.net/apidoc
Constructor Summary | |
---|---|
WebThumbService(java.lang.String apiKey)
|
Method Summary | |
---|---|
byte[] |
fetch(WebThumbFetchRequest webThumbFetchRequest)
Fetches single file form webthumb site. |
void |
fetch(WebThumbFetchRequest webThumbFetchRequest,
java.io.OutputStream outputStream)
Fetches single file form webthumb site and writes its content to given output stream. |
WebThumbCredits |
getCredits()
Lets you see how many credits you've used and how many subscription/reserve credits you have left. |
java.util.List<WebThumbStatus> |
getStatus(WebThumbStatusRequest webThumbStatusRequest)
Checks the status of given job or list of jobs. |
java.util.List<WebThumbJob> |
sendRequest(java.util.List<WebThumbRequest> webThumbRequests)
Sends thumbnail requests to webthumb site. |
WebThumbJob |
sendRequest(WebThumbRequest webThumbRequest)
Sends single thumbnail request to webthumb site. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebThumbService(java.lang.String apiKey)
Method Detail |
---|
public WebThumbJob sendRequest(WebThumbRequest webThumbRequest) throws WebThumbException
webThumbRequest
- object containing the request parameters
WebThumbException
- if the request fails for whatever reasonpublic java.util.List<WebThumbJob> sendRequest(java.util.List<WebThumbRequest> webThumbRequests) throws WebThumbException
webThumbRequests
- list of objects containing the request parameters
WebThumbException
- if the request fails for whatever reasonpublic byte[] fetch(WebThumbFetchRequest webThumbFetchRequest) throws WebThumbException
WebThumbFetchRequest
returned byte array
will be the content of the jpg, png, png8 or zip file.
webThumbFetchRequest
- fetch request containing the job and size to be fetched
WebThumbException
- if the file can not be fetched for whatever reasonpublic void fetch(WebThumbFetchRequest webThumbFetchRequest, java.io.OutputStream outputStream) throws WebThumbException
WebThumbFetchRequest
it will be the content of the jpg, png, png8 or zip file.
webThumbFetchRequest
- fetch request containing the job and size to be fetchedoutputStream
- output stream to write the result to
WebThumbException
- if the file can not be fetched for whatever reasonpublic java.util.List<WebThumbStatus> getStatus(WebThumbStatusRequest webThumbStatusRequest) throws WebThumbException
WebThumbRequest.setNotify(String)
and
WebThumbNotificationServlet
for more details!
webThumbStatusRequest
- fetch request containing the job and size to be fetched
WebThumbException
- if the file can not be fetched for whatever reasonpublic WebThumbCredits getCredits() throws WebThumbException
WebThumbException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |