Package org.cip4.jdflib.util
Class UrlPart
java.lang.Object
org.cip4.jdflib.util.UrlPart
- All Implemented Interfaces:
IStreamWriter,IPollDetails
simple struct to contain the stream and type of a bodypart
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUrlPart(HttpURLConnection connection) UrlPart(URLConnection connection, boolean isHttp) UrlPart(javax.mail.BodyPart part) -
Method Summary
Modifier and TypeMethodDescriptionvoidbuffer()buffer my input streamprotected voidfinalize()get the content type of the polled stuffintget the new response code (e.g.get the resulting stream - may be nullgetResponseString(int maxLen) static intreturns an xmldoc corresponding to this partbooleanisPush()we are pollingstatic booleanvoidsetInStream(InputStream inStream) toString()voidwrite myself to a stream
-
Field Details
-
contentLength
public long contentLengththe content length of this UrlPart
-
-
Constructor Details
-
UrlPart
- Parameters:
connection-- Throws:
IOException
-
UrlPart
- Parameters:
connection-isHttp-- Throws:
IOException
-
UrlPart
- Parameters:
part-- Throws:
javax.mail.MessagingExceptionIOException
-
UrlPart
- Parameters:
f-- Throws:
IOException
-
-
Method Details
-
getResponseCode
public int getResponseCode()Description copied from interface:IPollDetailsget the new response code (e.g. 200 for success)- Specified by:
getResponseCodein interfaceIPollDetails- Returns:
- the response code
-
writeStream
Description copied from interface:IStreamWriterwrite myself to a stream- Specified by:
writeStreamin interfaceIStreamWriter- Parameters:
os- the output stream- Throws:
IOException- if io snafu...
-
getContentType
Description copied from interface:IPollDetailsget the content type of the polled stuff- Specified by:
getContentTypein interfaceIPollDetails- Returns:
- the contentType
-
setInStream
- Parameters:
inStream- the inStream to set
-
getResponseStream
Description copied from interface:IPollDetailsget the resulting stream - may be null- Specified by:
getResponseStreamin interfaceIPollDetails- Returns:
- the response stream
- See Also:
-
getResponseString
- Parameters:
maxLen-- Returns:
-
getXMLDoc
returns an xmldoc corresponding to this part- Returns:
- the doc, null if not xml
-
buffer
public void buffer()buffer my input stream -
toString
-
getConnection
- Returns:
- the connection
-
isPush
public boolean isPush()we are polling- Specified by:
isPushin interfaceIPollDetails- Returns:
- false if polling; true if push environment
- See Also:
-
finalize
-
isReturnCodeOK
-
getReturnCode
-