|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wttools.protocols.AbstractProtocol
Class AbstractProtocol
implements
Field Summary | |
protected boolean |
allowAllCookies
|
protected boolean |
allowRedirect
|
protected boolean |
allowUserInteraction
|
protected long |
bytesDownloaded
|
protected java.lang.String |
clientId
|
protected boolean |
debug
|
protected int |
inputBufferSize
|
protected boolean |
keepAlive
|
protected java.lang.String |
requestData
|
protected int |
streamReadTimeout
|
protected URI |
uri
variable uri contains value of |
protected java.lang.String |
userName
variable userName contains value of |
protected java.lang.String |
userPassword
variable userPassword contains value of |
Fields inherited from interface wttools.protocols.ifc.ProtocolIfc |
CODE_BAD_REQUEST, CODE_CONNECTION_ERROR, CODE_CONNECTION_OK, CODE_FORBIDDEN, CODE_HOST_NOT_FOUND, CODE_INTERNAL_SERVER_ERROR, CODE_LENGTH_REQUIRED, CODE_NETWORK_NOT_REACHABLE, CODE_NO_CONTENT, CODE_NOT_FOUND, CODE_NOT_INITIALIZED, CODE_PARTIAL_CONTENT, CODE_REDIRECT, CODE_REQUEST_TIMEOUT, CODE_SERVER_NOT_REACHABLE, CODE_UNAUTHORIZED, CODE_VERSION_NOT_SUPPORTED, METHOD_GET, METHOD_HEAD |
Constructor Summary | |
AbstractProtocol()
|
Method Summary | |
protected void |
deb(java.lang.String str)
deb method performs |
java.lang.String |
getClientId()
Get the value of clientId . |
byte[] |
getContentData()
|
long |
getHeaderIntValue(java.lang.String param1)
Method getHeaderStrValue returns header value
as long integer for given header name. |
int |
getInputBufferSize()
Get the value of inputBufferSize . |
long |
getRealContentSize()
getRealContentSize method performs |
java.lang.String |
getRequestData()
Get the value of requestData. |
int |
getStreamReadTimeout()
Get the value of streamReadTimeout . |
URI |
getURI()
Get the value of uri . |
java.lang.String |
getUserName()
Get the value of userName . |
java.lang.String |
getUserPassword()
Get the value of userPassword . |
boolean |
isAllowAllCookies()
|
boolean |
isAllowRedirect()
|
boolean |
isAllowUserInteraction()
|
boolean |
isDebug()
Get the value of debug. |
boolean |
isErrorRecoverable(int code)
This method isErrorRecoverable should be able to return
info if given error code is permanent or not. |
boolean |
isKeepAlive()
Get the value of keepAlive . |
void |
saveContent(java.io.OutputStream out_stream)
saveContent method performs |
void |
saveContent(java.lang.String file_name)
saveContent method performs |
void |
setAllowAllCookies(boolean allow)
|
void |
setAllowRedirect(boolean redirect)
|
void |
setAllowUserInteraction(boolean allow)
|
void |
setClientId(java.lang.String v)
Set the value of clientId . |
void |
setDebug(boolean v)
Set the value of debug. |
void |
setInputBufferSize(int v)
Set the value of inputBufferSize . |
void |
setKeepAlive(boolean v)
Set the value of keepAlive . |
void |
setRequestData(java.lang.String v)
Set the value of requestData. |
void |
setStreamReadTimeout(int v)
Set the value of streamReadTimeout . |
void |
setURI(URI v)
Set the value of uri . |
void |
setUserName(java.lang.String v)
Set the value of userName . |
void |
setUserPassword(java.lang.String v)
Set the value of userPassword . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface wttools.protocols.ifc.ProtocolIfc |
connect, disconnect, getAllHeaders, getConnectionInfo, getConnectionResult, getConnectionStatuses, getContentLength, getContentType, getEffectiveURI, getHeaderStrValue, getInputStream, getProtocolType, getServerId, getTransferSpeed |
Field Detail |
protected URI uri
uri
contains value ofprotected java.lang.String userName
userName
contains value ofprotected java.lang.String userPassword
userPassword
contains value ofprotected java.lang.String clientId
protected java.lang.String requestData
protected boolean keepAlive
protected boolean debug
protected boolean allowUserInteraction
protected boolean allowAllCookies
protected boolean allowRedirect
protected int inputBufferSize
protected int streamReadTimeout
protected long bytesDownloaded
Constructor Detail |
public AbstractProtocol()
Method Detail |
public void setAllowRedirect(boolean redirect)
setAllowRedirect
in interface ProtocolIfc
public boolean isAllowRedirect()
isAllowRedirect
in interface ProtocolIfc
public java.lang.String getRequestData()
getRequestData
in interface ProtocolIfc
public void setRequestData(java.lang.String v)
setRequestData
in interface ProtocolIfc
v
- Value to assign to requestData.public void setAllowUserInteraction(boolean allow)
setAllowUserInteraction
in interface ProtocolIfc
public boolean isAllowUserInteraction()
isAllowUserInteraction
in interface ProtocolIfc
public void setAllowAllCookies(boolean allow)
setAllowAllCookies
in interface ProtocolIfc
public boolean isAllowAllCookies()
isAllowAllCookies
in interface ProtocolIfc
public boolean isDebug()
isDebug
in interface ProtocolIfc
public void setDebug(boolean v)
setDebug
in interface ProtocolIfc
v
- Value to assign to debug.public java.lang.String getUserPassword()
userPassword
.getUserPassword
in interface ProtocolIfc
userPassword
.public void setUserPassword(java.lang.String v)
userPassword
.setUserPassword
in interface ProtocolIfc
v
- Value to assign to userPassword
.public java.lang.String getUserName()
userName
.getUserName
in interface ProtocolIfc
userName
.public void setUserName(java.lang.String v)
userName
.setUserName
in interface ProtocolIfc
v
- Value to assign to userName
.public boolean isKeepAlive()
keepAlive
.isKeepAlive
in interface ProtocolIfc
keepAlive
.public void setKeepAlive(boolean v)
keepAlive
.setKeepAlive
in interface ProtocolIfc
v
- Value to assign to keepAlive
.public int getInputBufferSize()
inputBufferSize
.getInputBufferSize
in interface ProtocolIfc
inputBufferSize
.public void setInputBufferSize(int v)
inputBufferSize
.setInputBufferSize
in interface ProtocolIfc
v
- Value to assign to inputBufferSize
.public int getStreamReadTimeout()
streamReadTimeout
.getStreamReadTimeout
in interface ProtocolIfc
streamReadTimeout
.public void setStreamReadTimeout(int v)
streamReadTimeout
.setStreamReadTimeout
in interface ProtocolIfc
v
- Value to assign to streamReadTimeout
.public java.lang.String getClientId()
clientId
.getClientId
in interface ProtocolIfc
clientId
.public void setClientId(java.lang.String v)
clientId
.setClientId
in interface ProtocolIfc
v
- Value to assign to clientId
.public URI getURI()
uri
.getURI
in interface ProtocolIfc
uri
.public void setURI(URI v) throws java.io.IOException
uri
.setURI
in interface ProtocolIfc
v
- Value to assign to uri
.java.io.IOException
- if an error occurspublic long getRealContentSize()
getRealContentSize
method performsgetRealContentSize
in interface ProtocolIfc
long
valuepublic void saveContent(java.lang.String file_name) throws java.io.IOException
saveContent
method performssaveContent
in interface ProtocolIfc
file_name
- a String
valuejava.io.IOException
- if an error occurspublic void saveContent(java.io.OutputStream out_stream) throws java.io.IOException
saveContent
method performssaveContent
in interface ProtocolIfc
out_stream
- an OutputStream
valuejava.io.IOException
- if an error occurspublic byte[] getContentData() throws java.io.IOException
getContentData
in interface ProtocolIfc
public long getHeaderIntValue(java.lang.String param1) throws java.io.IOException
ProtocolIfc
getHeaderStrValue
returns header value
as long
integer for given header name.getHeaderIntValue
in interface ProtocolIfc
param1
- protected void deb(java.lang.String str)
deb
method performsstr
- a String
valuepublic boolean isErrorRecoverable(int code)
ProtocolIfc
isErrorRecoverable
should be able to return
info if given error code is permanent or not. I mean for example if
error code means "Page not found" it mean that there is no page
under requested URL. It is most probably permanent error. However
if error code means "Network not reachable" or
"Request timeout" it mean that in future during next try download
may be successful.isErrorRecoverable
in interface ProtocolIfc
wttools.protocols.ifc.ProtocolIfc
code
- an int
value of requested error code.boolean
calculated value of recoverability of error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |