net.asplode.tumblr
Class Post

java.lang.Object
  extended by net.asplode.tumblr.Post
Direct Known Subclasses:
AudioPost, ConversationPost, LinkPost, PhotoPost, QuotePost, ReblogPost, TextPost, VideoPost

public abstract class Post
extends java.lang.Object


Nested Class Summary
static class Post.State
           
 
Constructor Summary
Post()
           
 
Method Summary
 int postToTumblr()
           
 int postToTumblr(java.lang.String postId)
           
 void setBlog(java.lang.String blog)
           
 void setCredentials(java.lang.String email, java.lang.String password)
           
 void setGenerator(java.lang.String generator)
           
 void setPostUrl(java.lang.String postUrl)
           
 void setPrivate(boolean state)
           
 void setPublishOn(java.lang.String date)
           
 void setSlug(java.lang.String slug)
           
 void setState(Post.State state)
           
 void setTags(java.lang.String tags)
           
 void setTwitter(java.lang.String twitter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Post

public Post()
Method Detail

setPostUrl

public void setPostUrl(java.lang.String postUrl)

postToTumblr

public int postToTumblr()
                 throws NoCredentialsException,
                        org.apache.http.client.ClientProtocolException,
                        java.io.IOException
Returns:
HTTP status code
Throws:
NoCredentialsException
org.apache.http.client.ClientProtocolException
java.io.IOException

postToTumblr

public int postToTumblr(java.lang.String postId)
                 throws NoCredentialsException,
                        org.apache.http.client.ClientProtocolException,
                        java.io.IOException
Parameters:
postId - The id of the post to be modified.
Returns:
HTTP status code
Throws:
NoCredentialsException
org.apache.http.client.ClientProtocolException
java.io.IOException

setBlog

public void setBlog(java.lang.String blog)
             throws java.io.UnsupportedEncodingException
Parameters:
blog - The blog to post to.
Throws:
java.io.UnsupportedEncodingException

setCredentials

public void setCredentials(java.lang.String email,
                           java.lang.String password)
                    throws java.io.UnsupportedEncodingException
Parameters:
email - Email address
password - Password
Throws:
java.io.UnsupportedEncodingException

setGenerator

public void setGenerator(java.lang.String generator)
                  throws java.io.UnsupportedEncodingException
Parameters:
generator - A short description of the application making the request. Max 64 characters.
Throws:
java.io.UnsupportedEncodingException

setPrivate

public void setPrivate(boolean state)
                throws java.io.UnsupportedEncodingException
Parameters:
state - True if the post should be private. False otherwise.
Throws:
java.io.UnsupportedEncodingException

setPublishOn

public void setPublishOn(java.lang.String date)
                  throws java.io.UnsupportedEncodingException
Parameters:
date - Publish date and time for queued posts
Throws:
java.io.UnsupportedEncodingException

setSlug

public void setSlug(java.lang.String slug)
             throws java.io.UnsupportedEncodingException
Parameters:
slug - Custom string to appear in the post's URL
Throws:
java.io.UnsupportedEncodingException

setState

public void setState(Post.State state)
              throws java.io.UnsupportedEncodingException
Parameters:
state - Post state.
Throws:
java.io.UnsupportedEncodingException
See Also:
Post.State

setTags

public void setTags(java.lang.String tags)
             throws java.io.UnsupportedEncodingException
Parameters:
tags - Comma-separated list of post tags
Throws:
java.io.UnsupportedEncodingException

setTwitter

public void setTwitter(java.lang.String twitter)
                throws java.io.UnsupportedEncodingException
Parameters:
twitter - One of the following values:
"no" - Do not send post to twitter.
"auto" - Send to Twitter with an automatically generated summary of the post.
Any other value - A custom message to send to Twitter for this post.
Throws:
java.io.UnsupportedEncodingException