Package org.cip4.jdflib.util
Class URLWriter
- java.lang.Object
-
- org.cip4.jdflib.util.URLWriter
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
UrlUtil.URLWriter
public class URLWriter extends java.lang.Object implements java.lang.Runnable
-
-
Constructor Summary
Constructors Constructor Description URLWriter(java.io.InputStream is, java.lang.String strUrl, java.lang.String method, java.lang.String contentType, HTTPDetails details)URLWriter(java.io.InputStream is, java.net.URL url, java.lang.String method, java.lang.String contentType, HTTPDetails details)URLWriter(java.lang.String strUrl, IStreamWriter streamWriter, java.lang.String method, java.lang.String contentType, HTTPDetails details)URLWriter(java.net.URL url, IStreamWriter streamWriter, java.lang.String method, java.lang.String contentType, HTTPDetails details)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UrlPartcallProxy(java.net.Proxy proxy)protected UrlPartcallProxy(java.net.Proxy proxy, boolean bWantLog)java.lang.ThrowablegetLastException()protected java.util.List<java.net.Proxy>getProxies(java.net.URI uri)booleanisAddDirect()voidrun()useful for asynchronous sending to a urlvoidsetAddDirect(boolean addDirect)java.lang.StringtoString()UrlPartwriteToURL()write a Stream to an output URL File: and http: are currently supported Use HttpURLConnection.getInputStream() to retrieve the http response
-
-
-
Constructor Detail
-
URLWriter
public URLWriter(java.net.URL url, IStreamWriter streamWriter, java.lang.String method, java.lang.String contentType, HTTPDetails details)- Parameters:
strUrl- the URL to write tostream- the input stream to read fromstreamWriter-method- HEAD, GET or POSTcontentType- the contenttype to set, if NULL defaults to TEXT/UNKNOWNdetails-
-
URLWriter
public URLWriter(java.lang.String strUrl, IStreamWriter streamWriter, java.lang.String method, java.lang.String contentType, HTTPDetails details)- Parameters:
strUrl- the URL to write tostream- the input stream to read fromstreamWriter-method- HEAD, GET or POSTcontentType- the contenttype to set, if NULL defaults to TEXT/UNKNOWNdetails-
-
URLWriter
public URLWriter(java.io.InputStream is, java.lang.String strUrl, java.lang.String method, java.lang.String contentType, HTTPDetails details)- Parameters:
strUrl- the URL to write tostream- the input stream to read fromstreamWriter-method- HEAD, GET or POSTcontentType- the contenttype to set, if NULL defaults to TEXT/UNKNOWNdetails-
-
URLWriter
public URLWriter(java.io.InputStream is, java.net.URL url, java.lang.String method, java.lang.String contentType, HTTPDetails details)- Parameters:
strUrl- the URL to write tostream- the input stream to read fromstreamWriter-method- HEAD, GET or POSTcontentType- the contenttype to set, if NULL defaults to TEXT/UNKNOWNdetails-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
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:
UrlPartthe opened http connection, null in case of error
-
getProxies
protected java.util.List<java.net.Proxy> getProxies(java.net.URI uri)
-
callProxy
protected UrlPart callProxy(java.net.Proxy proxy, boolean bWantLog)
- Parameters:
proxy-bWantLog-- Returns:
-
callProxy
protected UrlPart callProxy(java.net.Proxy proxy) throws java.io.IOException, java.net.ProtocolException
- Throws:
java.io.IOExceptionjava.net.ProtocolException
-
getLastException
public java.lang.Throwable getLastException()
-
run
public void run()
useful for asynchronous sending to a url- Specified by:
runin interfacejava.lang.Runnable- See Also:
Runnable.run()
-
-