Class UrlPart

java.lang.Object
org.cip4.jdflib.util.UrlPart
All Implemented Interfaces:
IStreamWriter, IPollDetails

public class UrlPart extends Object implements IPollDetails, IStreamWriter
simple struct to contain the stream and type of a bodypart
  • Field Details

    • contentLength

      public long contentLength
      the content length of this UrlPart
  • Constructor Details

  • Method Details

    • 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
    • writeStream

      public void writeStream(OutputStream os) throws IOException
      Description copied from interface: IStreamWriter
      write myself to a stream
      Specified by:
      writeStream in interface IStreamWriter
      Parameters:
      os - the output stream
      Throws:
      IOException - if io snafu...
    • 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:
    • getResponseString

      public String getResponseString(int maxLen)
      Parameters:
      maxLen -
      Returns:
    • 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:
    • getConnection

      public URLConnection getConnection()
      Returns:
      the connection
    • isPush

      public boolean isPush()
      we are polling
      Specified by:
      isPush in interface IPollDetails
      Returns:
      false if polling; true if push environment
      See Also:
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • isReturnCodeOK

      public static boolean isReturnCodeOK(UrlPart p)
    • getReturnCode

      public static int getReturnCode(UrlPart p)