|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.easysw.cups.IPPHttp
Constructor Summary | |
IPPHttp(java.lang.String request_url)
Constructor using URL . |
|
IPPHttp(java.lang.String request_url,
java.lang.String p_auth_type,
java.lang.String p_user,
java.lang.String p_passwd)
Constructor using URL, user and pass . |
Method Summary | |
int |
checkForResponse()
|
void |
parseAuthenticate(java.lang.String p_auth)
|
IPP |
processResponse()
Process the HTTP response from the server. |
int |
read_header()
Read the HTTP header from the input stream. |
java.lang.String |
read_line()
Read a line from the input stream. |
char[] |
read(int count)
Read up to count bytes from the input stream. |
boolean |
reConnect()
Re-establish a dropped connection. |
void |
setPassword(java.lang.String p_passwd)
Set the password. |
void |
setUser(java.lang.String p_user)
Set the user name. |
void |
write(byte[] bytes)
Write bytes to the output stream. |
void |
write(byte[] bytes,
int length)
Write bytes to the output stream. |
int |
writeHeader(java.lang.String request,
int content_length)
Write the request header bytes to the server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HTTP_WAITING
public static final int HTTP_OPTIONS
public static final int HTTP_GET
public static final int HTTP_GET_SEND
public static final int HTTP_HEAD
public static final int HTTP_POST
public static final int HTTP_POST_RECV
public static final int HTTP_POST_SEND
public static final int HTTP_PUT
public static final int HTTP_PUT_RECV
public static final int HTTP_DELETE
public static final int HTTP_TRACE
public static final int HTTP_CLOSE
public static final int HTTP_STATUS
public static final int HTTP_0_9
public static final int HTTP_1_0
public static final int HTTP_1_1
public static final int HTTP_KEEPALIVE_OFF
public static final int HTTP_KEEPALIVE_ON
public static final int HTTP_ENCODE_LENGTH
public static final int HTTP_ENCODE_CHUNKED
public static final int HTTP_ENCRYPT_IF_REQUESTED
public static final int HTTP_ENCRYPT_NEVER
public static final int HTTP_ENCRYPT_REQUIRED
public static final int HTTP_ENCRYPT_ALWAYS
public static final int HTTP_AUTH_NONE
public static final int HTTP_AUTH_BASIC
public static final int HTTP_AUTH_MD5
public static final int HTTP_AUTH_MD5_SESS
public static final int HTTP_AUTH_MD5_INT
public static final int HTTP_AUTH_MD5_SESS_INT
public static final int HTTP_ERROR
public static final int HTTP_CONTINUE
public static final int HTTP_SWITCHING_PROTOCOLS
public static final int HTTP_OK
public static final int HTTP_CREATED
public static final int HTTP_ACCEPTED
public static final int HTTP_NOT_AUTHORITATIVE
public static final int HTTP_NO_CONTENT
public static final int HTTP_RESET_CONTENT
public static final int HTTP_PARTIAL_CONTENT
public static final int HTTP_MULTIPLE_CHOICES
public static final int HTTP_MOVED_PERMANENTLY
public static final int HTTP_MOVED_TEMPORARILY
public static final int HTTP_SEE_OTHER
public static final int HTTP_NOT_MODIFIED
public static final int HTTP_USE_PROXY
public static final int HTTP_BAD_REQUEST
public static final int HTTP_UNAUTHORIZED
public static final int HTTP_PAYMENT_REQUIRED
public static final int HTTP_FORBIDDEN
public static final int HTTP_NOT_FOUND
public static final int HTTP_METHOD_NOT_ALLOWED
public static final int HTTP_NOT_ACCEPTABLE
public static final int HTTP_PROXY_AUTHENTICATION
public static final int HTTP_REQUEST_TIMEOUT
public static final int HTTP_CONFLICT
public static final int HTTP_GONE
public static final int HTTP_LENGTH_REQUIRED
public static final int HTTP_PRECONDITION
public static final int HTTP_REQUEST_TOO_LARGE
public static final int HTTP_URI_TOO_LONG
public static final int HTTP_UNSUPPORTED_MEDIATYPE
public static final int HTTP_UPGRADE_REQUIRED
public static final int HTTP_SERVER_ERROR
public static final int HTTP_NOT_IMPLEMENTED
public static final int HTTP_BAD_GATEWAY
public static final int HTTP_SERVICE_UNAVAILABLE
public static final int HTTP_GATEWAY_TIMEOUT
public static final int HTTP_NOT_SUPPORTED
public static final int HTTP_FIELD_UNKNOWN
public static final int HTTP_FIELD_ACCEPT_LANGUAGE
public static final int HTTP_FIELD_ACCEPT_RANGES
public static final int HTTP_FIELD_AUTHORIZATION
public static final int HTTP_FIELD_CONNECTION
public static final int HTTP_FIELD_CONTENT_ENCODING
public static final int HTTP_FIELD_CONTENT_LANGUAGE
public static final int HTTP_FIELD_CONTENT_LENGTH
public static final int HTTP_FIELD_CONTENT_LOCATION
public static final int HTTP_FIELD_CONTENT_MD5
public static final int HTTP_FIELD_CONTENT_RANGE
public static final int HTTP_FIELD_CONTENT_TYPE
public static final int HTTP_FIELD_CONTENT_VERSION
public static final int HTTP_FIELD_DATE
public static final int HTTP_FIELD_HOST
public static final int HTTP_FIELD_IF_MODIFIED_SINCE
public static final int HTTP_FIELD_IF_UNMODIFIED_SINCE
public static final int HTTP_FIELD_KEEP_ALIVE
public static final int HTTP_FIELD_LAST_MODIFIED
public static final int HTTP_FIELD_LINK
public static final int HTTP_FIELD_LOCATION
public static final int HTTP_FIELD_RANGE
public static final int HTTP_FIELD_REFERER
public static final int HTTP_FIELD_RETRY_AFTER
public static final int HTTP_FIELD_TRANSFER_ENCODING
public static final int HTTP_FIELD_UPGRADE
public static final int HTTP_FIELD_USER_AGENT
public static final int HTTP_FIELD_WWW_AUTHENTICATE
public static final int HTTP_FIELD_MAX
public static final java.lang.String[] http_fields
public static final java.lang.String[] days
public static final java.lang.String[] months
public java.net.Socket conn
public boolean connected
public java.io.BufferedInputStream is
public java.io.BufferedReader br
public java.io.BufferedOutputStream os
public int write_content_length
public java.lang.String read_header_date
public java.lang.String read_header_server
public java.lang.String read_header_charset
public java.lang.String read_header_content_language
public java.lang.String read_header_content_type
public int read_header_content_length
public char[] read_buffer
public int status
public java.lang.String status_text
public java.lang.String version
public int error
public int activity
public java.lang.String hostname
public int port
public java.lang.String path
public java.lang.String user
public java.lang.String passwd
public java.lang.String auth_type
public java.lang.String realm
public java.lang.String opaque
public java.lang.String nonce
public java.lang.String resource
public java.lang.String method
public java.lang.String http_request
public int http_content_length
Constructor Detail |
public IPPHttp(java.lang.String request_url) throws java.io.IOException, java.net.UnknownHostException
URL
.request_url
- URL
of server to connect to.public IPPHttp(java.lang.String request_url, java.lang.String p_auth_type, java.lang.String p_user, java.lang.String p_passwd) throws java.io.IOException, java.net.UnknownHostException
URL, user and pass
.request_url
- URL
of server to connect to.p_auth_type
- String
basic or digest.p_user
- String
User name.p_passwd
- String
password.Method Detail |
public boolean reConnect() throws java.io.IOException
boolean
True if connected.public void setUser(java.lang.String p_user)
p_user
- String
- user name.public void setPassword(java.lang.String p_passwd)
p_passwd
- String
- password.public int writeHeader(java.lang.String request, int content_length) throws java.io.IOException
request
- String
- the request.content_length
- int
- size of the total request.public int checkForResponse()
public void write(byte[] bytes) throws java.io.IOException
bytes
- Array of bytes to write to the stream.public void write(byte[] bytes, int length) throws java.io.IOException
bytes
- Array of bytes to write to the stream.length
- Number of bytes to write to the stream.public int read_header() throws java.io.IOException
int
Content length of response.public java.lang.String read_line() throws java.io.IOException
String
Line read.public char[] read(int count) throws java.io.IOException
count
bytes from the input stream.count
- Number of bytes to read.char[]
Character array of data read.public IPP processResponse()
IPP
IPP object containing response data.IPP
,
IPPRequest
,
IPPAttribute
,
IPPValue
,
IPPDefs
public void parseAuthenticate(java.lang.String p_auth)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |