|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnesstar.api.MIMEObject
public class MIMEObject
A MIME object (actually a MIME text object such as text/html).
| Constructor Summary | |
|---|---|
MIMEObject(String url)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
byte[] content,
String encoding)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
File content)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
File content,
String encoding)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
String content)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
String content,
int statusCode)
Constructor for the MIMEObject object |
|
MIMEObject(String type,
URL content)
Constructor for the MIMEObject object |
|
MIMEObject(String url,
Vector headers)
Constructor for the MIMEObject object |
|
MIMEObject(URL url)
Constructor for the MIMEObject object |
|
MIMEObject(URL url,
int timeout,
Vector headers,
boolean plain)
|
|
MIMEObject(URL url,
String expextedContentType,
boolean enforceType)
Create a MIMEObject reading from a given URL |
|
MIMEObject(URL url,
Vector headers)
Constructor for the MIMEObject object |
|
| Method Summary | |
|---|---|
String |
getAction()
|
byte[] |
getBinaryContent()
Gets the binaryContent attribute of the MIMEObject object |
String |
getContent()
Gets the content attribute of the MIMEObject object |
File |
getContentAsFile(File file)
|
File |
getContentAsFile(String file)
|
String |
getContentAsString()
Gets the content attribute of the MIMEObject object |
int |
getContentSize()
Gets the contentSize attribute of the MIMEObject object |
String |
getEncoding()
Gets the encoding attribute of the MIMEObject object |
int |
getStatusCode()
Gets the statusCode attribute of the MIMEObject object |
String |
getSuspendedOpID()
Gets the suspendedOpID attribute of the MIMEObject object |
String |
getType()
Gets the type attribute of the MIMEObject object |
String |
getXMLCharacterEncoding()
Get the character encoding for a text/xml MIMEObject. |
boolean |
hasFileContent()
Test if MIME Object's content is stored in a uncompressed UNICODE string |
boolean |
hasStringContent()
Test if MIME Object's content is stored in a uncompressed UNICODE string |
static MIMEObject |
httpExecute(URL url,
int timeout)
Execute the invocation through HTTP |
static MIMEObject |
httpExecute(URL url,
int timeout,
Vector headers)
Execute the invocation through HTTP |
boolean |
isAction()
check if any action is associated to the MIMEObject |
boolean |
isBinary()
Gets the binary attribute of the MIMEObject object |
boolean |
isChallenge()
Gets the challenge attribute of the MIMEObject object |
boolean |
isError()
Gets the error attribute of the MIMEObject object |
boolean |
isUnauthorizedError()
Gets the unauthorizedError attribute of the MIMEObject object |
boolean |
isZipped()
|
void |
methodExecute(org.apache.commons.httpclient.HttpMethod method)
It seems that the timeout doesn't work as expected so we enforce a total timeout for the method execution * |
void |
output(OutputStream out)
Method |
void |
output(OutputStream out,
String encoding)
Write the content of a MIME object to a byte stream. |
static MIMEObject |
plainHTTPGetExecute(URL url,
int timeout)
|
static MIMEObject |
plainHTTPGetExecute(URL url,
int timeout,
Vector headers)
|
void |
setAction(String action)
Sets the _action of the MIMEObject object |
void |
setChallengeForOp(String op)
Sets the challengeForOp attribute of the MIMEObject object |
void |
setStatusCode(int statusCode)
Sets the statusCode attribute of the MIMEObject object |
void |
setUnauthorizedCode()
Sets the unauthorizedCode attribute of the MIMEObject object |
String |
toString()
Method |
void |
zip()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String UTF_8
public static final String ISO_8859_1
public static final String TEXT_PLAIN
public static final String TEXT_HTML
public static final String TEXT_XML
public static final String TEXT_RDF
public static final String IMAGE_GIF
public static final String IMAGE_JPEG
public static final String APPLICATION_ZIP
public static final String APPLICATION_GZIP
public static final String APPLICATION_BINARY
public static final String APPLICATION_EXE
public static final String APPLICATION_MSWORD
public static final String APPLICATION_PDF
public static final String APPLICATION_POSTSCRIPT
public static final String MULTIPART_MIXED
public static final String MULTIPART_FORM_DATA
public static final String HEADER_VIA
public static final String HEADER_AUTHENTICATION
public static final String HEADER_X_FORWARDED_FOR
public static final String VAR_OPID
public static final String NESSTAR_RDF
public static final String NESSTAR_STAT
public static final String APPLICATION_NESSTAR_STAT
public static final String NESSTAR_EXPLORER
public static final String NESSTAR_BOOKMARK_LIST
public static final String ENCODING_GZIP
public static final String ENCODING_DEFLATE
public static final String TEXT_URL
public static final String CHALLENGE
public final int SC_OK
public static final String CONNECTION_CONTEXT
| Constructor Detail |
|---|
public MIMEObject(String type,
String content)
type - content -
public MIMEObject(String type,
String content,
int statusCode)
type - content - statusCode -
public MIMEObject(String type,
byte[] content,
String encoding)
type - content - encoding -
public MIMEObject(String type,
File content)
type - content -
public MIMEObject(String type,
URL content)
type - content -
public MIMEObject(String type,
File content,
String encoding)
type - content - encoding -
public MIMEObject(URL url,
String expextedContentType,
boolean enforceType)
throws Exception
expextedContentType - the name says it allenforceType - if true an execption is generated if the information retrieved is not of the correct typeurl - @bug wont handle binary types
Exception
public MIMEObject(URL url,
Vector headers)
throws Exception
url -
Exception
public MIMEObject(String url,
Vector headers)
throws Exception
url - the url to retrieve
Exception
public MIMEObject(String url)
throws Exception
url - the url to retrieve
Exception
public MIMEObject(URL url)
throws Exception
url - the url to retrieve
Exception
public MIMEObject(URL url,
int timeout,
Vector headers,
boolean plain)
throws Exception
Exception| Method Detail |
|---|
public void setStatusCode(int statusCode)
statusCode - The new statusCode valuepublic void setUnauthorizedCode()
public void setChallengeForOp(String op)
op - The new challengeForOp valuepublic void setAction(String action)
action - public String getType()
public String getEncoding()
public int getStatusCode()
public int getContentSize()
public boolean isError()
public boolean isUnauthorizedError()
public boolean isBinary()
public String getContentAsString()
throws Exception
Exception
public File getContentAsFile(String file)
throws Exception
Exception
public File getContentAsFile(File file)
throws Exception
Exception
public String getContent()
throws Exception
Exception
public byte[] getBinaryContent()
throws Exception
Exceptionpublic String getSuspendedOpID()
public boolean isChallenge()
public boolean isAction()
public String getAction()
public String getXMLCharacterEncoding()
throws Exception
Exceptionpublic boolean isZipped()
public void output(OutputStream out)
throws IOException
out -
IOException
public void output(OutputStream out,
String encoding)
throws IOException
out - the output byte streamencoding - the character encoding
IOException
public void zip()
throws Exception
Exceptionpublic boolean hasStringContent()
public boolean hasFileContent()
public String toString()
toString in class Object
public static MIMEObject httpExecute(URL url,
int timeout)
throws Exception
url - timeout -
Exception
public static MIMEObject httpExecute(URL url,
int timeout,
Vector headers)
throws Exception
url - timeout - headers -
Exception
public static MIMEObject plainHTTPGetExecute(URL url,
int timeout)
throws Exception
Exception
public static MIMEObject plainHTTPGetExecute(URL url,
int timeout,
Vector headers)
throws Exception
Exception
public void methodExecute(org.apache.commons.httpclient.HttpMethod method)
throws Exception
Exception
|
Nesstar SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||