org.cip4.jdflib.util
Class UrlPart

java.lang.Object
  extended by org.cip4.jdflib.util.UrlPart
All Implemented Interfaces:
IPollDetails

public class UrlPart
extends Object
implements IPollDetails

simple struct to contain the stream and type of a bodypart

Author:
prosirai

Field Summary
 long contentLength
          the content length of this UrlPart
 
Constructor Summary
UrlPart(javax.mail.BodyPart part)
           
UrlPart(File f)
           
UrlPart(HttpURLConnection connection)
           
 
Method Summary
 void buffer()
          buffer my input stream
 HttpURLConnection getConnection()
           
 String getContentType()
          get the content type of the polled stuff
 int getResponseCode()
          get the new response code (e.g. 200 for success)
 InputStream getResponseStream()
          get the resulting stream - may be null
 XMLDoc getXMLDoc()
          returns an xmldoc corresponding to this part
 void setInStream(InputStream inStream)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contentLength

public long contentLength
the content length of this UrlPart

Constructor Detail

UrlPart

public UrlPart(HttpURLConnection connection)
        throws IOException
Parameters:
connection -
Throws:
IOException

UrlPart

public UrlPart(javax.mail.BodyPart part)
        throws javax.mail.MessagingException,
               IOException
Parameters:
part -
Throws:
javax.mail.MessagingException
IOException

UrlPart

public UrlPart(File f)
        throws IOException
Parameters:
f -
Throws:
IOException
Method Detail

getResponseCode

public int getResponseCode()
Description copied from interface: IPollDetails
get the new response code (e.g. 200 for success)

Specified by:
getResponseCode in interface IPollDetails
Returns:
the response code

getContentType

public String getContentType()
Description copied from interface: IPollDetails
get the content type of the polled stuff

Specified by:
getContentType in interface IPollDetails
Returns:
the contentType

setInStream

public void setInStream(InputStream inStream)
Parameters:
inStream - the inStream to set

getResponseStream

public InputStream getResponseStream()
Description copied from interface: IPollDetails
get the resulting stream - may be null

Specified by:
getResponseStream in interface IPollDetails
Returns:
the response stream
See Also:
IPollDetails.getResponseStream()

getXMLDoc

public XMLDoc getXMLDoc()
returns an xmldoc corresponding to this part

Returns:
the doc, null if not xml

buffer

public void buffer()
buffer my input stream


toString

public String toString()
Overrides:
toString in class Object
Returns:
the string representation
See Also:
Object.toString()

getConnection

public HttpURLConnection getConnection()
Returns:
the connection


Copyright © 2013. All Rights Reserved.