Class URLWriter

java.lang.Object
org.cip4.jdflib.util.URLWriter
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
UrlUtil.URLWriter

public class URLWriter extends Object implements Runnable
  • Constructor Details

    • URLWriter

      public URLWriter(URL url, IStreamWriter streamWriter, String method, String contentType, HTTPDetails details)
      Parameters:
      strUrl - the URL to write to
      stream - the input stream to read from
      streamWriter -
      method - HEAD, GET or POST
      contentType - the contenttype to set, if NULL defaults to TEXT/UNKNOWN
      details -
    • URLWriter

      public URLWriter(String strUrl, IStreamWriter streamWriter, String method, String contentType, HTTPDetails details)
      Parameters:
      strUrl - the URL to write to
      stream - the input stream to read from
      streamWriter -
      method - HEAD, GET or POST
      contentType - the contenttype to set, if NULL defaults to TEXT/UNKNOWN
      details -
    • URLWriter

      public URLWriter(InputStream is, String strUrl, String method, String contentType, HTTPDetails details)
      Parameters:
      strUrl - the URL to write to
      stream - the input stream to read from
      streamWriter -
      method - HEAD, GET or POST
      contentType - the contenttype to set, if NULL defaults to TEXT/UNKNOWN
      details -
    • URLWriter

      public URLWriter(InputStream is, URL url, String method, String contentType, HTTPDetails details)
      Parameters:
      strUrl - the URL to write to
      stream - the input stream to read from
      streamWriter -
      method - HEAD, GET or POST
      contentType - the contenttype to set, if NULL defaults to TEXT/UNKNOWN
      details -
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • isAddDirect

      public boolean isAddDirect()
    • setAddDirect

      public void setAddDirect(boolean addDirect)
    • writeToURL

      public UrlPart writeToURL()
      write a Stream to an output URL File: and http: are currently supported Use HttpURLConnection.getInputStream() to retrieve the http response
      Returns:
      UrlPart the opened http connection, null in case of error
    • getProxies

      protected List<Proxy> getProxies(URI uri)
    • callProxy

      protected UrlPart callProxy(Proxy proxy, boolean bWantLog)
      Parameters:
      proxy -
      bWantLog -
      Returns:
    • callProxy

      protected UrlPart callProxy(Proxy proxy) throws IOException, ProtocolException
      Throws:
      IOException
      ProtocolException
    • getLastException

      public Throwable getLastException()
    • run

      public void run()
      useful for asynchronous sending to a url
      Specified by:
      run in interface Runnable
      See Also: