|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.nntp.spi.FArticlePostUtil
public final class FArticlePostUtil
Utility class that aides the ForumSession class parse a posted article and insert it into the appropriate forum.
Field Summary | |
---|---|
static java.lang.String |
MULTIPART_ALTERNATIVE
|
static java.lang.String |
MULTIPART_MIXED
|
static java.lang.String |
MULTIPART_RELATED
|
static java.lang.String |
TEXT_HTML
|
static java.lang.String |
TEXT_PLAIN
|
Method Summary | |
---|---|
static ForumMessage[] |
createMessages(ForumSession session,
MimeTools.Headers mainHeaders,
MimeTools.Headers headers,
java.lang.String body)
Posts the given article with mainHeaders and body to the forum. |
static ForumMessage[] |
parseAlternative(ForumSession session,
MimeTools.Headers mainHeaders,
java.util.Iterator rawArticle,
java.lang.String mimeBoundary)
Parse a multipart alternative body part searching for the start of the text/plain part. |
static ForumMessage[] |
parseBody(ForumSession session,
MimeTools.Headers mainHeaders,
MimeTools.Headers headers,
java.nio.charset.Charset charset,
java.util.Iterator rawArticle,
java.lang.String encoding,
java.lang.String type)
Parses the raw article and pushes the data as plain text into a body string. |
static void |
parseMultipart(java.util.Iterator rawArticle,
MimeTools.Headers mainHeaders,
java.lang.String mimeBoundary,
ForumSession session)
Parse a multipart body part. |
static void |
post(java.util.Iterator rawArticle,
ForumSession session)
Post the article to the appropriate forum in the given factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TEXT_PLAIN
public static final java.lang.String TEXT_HTML
public static final java.lang.String MULTIPART_MIXED
public static final java.lang.String MULTIPART_RELATED
public static final java.lang.String MULTIPART_ALTERNATIVE
Method Detail |
---|
public static void post(java.util.Iterator rawArticle, ForumSession session) throws PostRejectedException, PostFailedException, NoPermissionException
rawArticle
- iterator over the String lines of the raw article.session
- nntp session for updating the forum cluster.
PostRejectedException
PostFailedException
NoPermissionException
public static ForumMessage[] createMessages(ForumSession session, MimeTools.Headers mainHeaders, MimeTools.Headers headers, java.lang.String body) throws PostFailedException, NoPermissionException
mainHeaders
- the mainHeaders of the message to be posted.body
- the body of the message to be posted.session
- the nntp session to post to.
NoPermissionException
- if the poster did not have permission to post.
PostFailedException
- if the post failed.public static void parseMultipart(java.util.Iterator rawArticle, MimeTools.Headers mainHeaders, java.lang.String mimeBoundary, ForumSession session) throws PostFailedException, PostRejectedException, NoPermissionException, java.io.IOException
rawArticle
- the raw article iterator pointing at the line following the headers.mimeBoundary
- the boundary of the mime parts.mainHeaders
- the headers of the main message.session
- nntp session for updating the forum cluster.
NoPermissionException
- if the poster did not have permission to post.
java.io.IOException
- if there was problems reading the attachment from the stream
PostFailedException
PostRejectedException
public static ForumMessage[] parseBody(ForumSession session, MimeTools.Headers mainHeaders, MimeTools.Headers headers, java.nio.charset.Charset charset, java.util.Iterator rawArticle, java.lang.String encoding, java.lang.String type) throws java.io.IOException, PostFailedException, PostRejectedException, NoPermissionException
session
- the NNTP session for accessing the forums system.mainHeaders
- the main mainHeaders to obtain the subject etc of the article.headers
- the headers of the individual partcharset
- the charset the article uses.rawArticle
- the raw article data to be added.encoding
- the encoding of the body text.type
- the type of the body (should be "text/plain" or "text/html".
java.io.IOException
- if there was trouble reading the message data.
PostFailedException
- if the posting failed.
PostRejectedException
- if post rejected.
NoPermissionException
- if sufficient permissions were not available to
add the body to forums (redundant to UnauthorizedException).public static ForumMessage[] parseAlternative(ForumSession session, MimeTools.Headers mainHeaders, java.util.Iterator rawArticle, java.lang.String mimeBoundary) throws java.io.IOException, PostFailedException, PostRejectedException, NoPermissionException
session
- the NNTP session used to query for message information.mainHeaders
- the headers of the main message.rawArticle
- The raw article iterator pointing at the line following
the headers.mimeBoundary
- the boundary of the mime parts.
java.io.IOException
- if there was trouble reading the message data.
NoPermissionException
- if sufficient permissions were not available to
add the body to forums (redundant to UnauthorizedException).
PostFailedException
PostRejectedException
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |