| java.lang.Object com.caucho.vfs.StreamImpl com.caucho.vfs.HttpStream
HttpStream | class HttpStream extends StreamImpl (Code) | | Underlying stream handling HTTP requests.
|
Method Summary | |
public boolean | canRead() The stream is readable. | public boolean | canWrite() | public void | close() Close the connection. | public Object | getAttribute(String name) Returns a header from the response returned from the HTTP server. | public Iterator | getAttributeNames() Returns an iterator of the returned header names. | public int | getAvailable() Returns the bytes still available. | public String | getHost() Returns the stream's host. | public int | getPort() Returns the stream's port. | public boolean | isSSL() Set if this should be an SSL connection. | static HttpStreamWrapper | openRead(HttpPath path) Opens a new HTTP stream for reading, i.e. | static HttpStreamWrapper | openReadWrite(HttpPath path) Opens a new HTTP stream for reading and writing, i.e. | public int | read(byte[] buf, int offset, int length) Read data from the connection. | public int | readInt(byte[] buf, int offset, int length) Read data from the connection. | public void | removeAttribute(String name) Remove a header for the request. | public void | setAttribute(String name, Object value) Sets a header for the request. | public void | setHead(boolean isHead) Sets true if we're only interested in the head. | public void | setMethod(String method) | public void | setSSL(boolean isSSL) Set if this should be an SSL connection. | public void | setSocketTimeout(long timeout) Sets the timeout. | public void | write(byte[] buf, int offset, int length, boolean isEnd) Writes a buffer to the underlying stream. |
canRead | public boolean canRead()(Code) | | The stream is readable.
|
canWrite | public boolean canWrite()(Code) | | The stream is always writable (?)
|
getAttribute | public Object getAttribute(String name) throws IOException(Code) | | Returns a header from the response returned from the HTTP server.
Parameters: name - name of the header the header value. |
getAttributeNames | public Iterator getAttributeNames() throws IOException(Code) | | Returns an iterator of the returned header names.
|
getAvailable | public int getAvailable() throws IOException(Code) | | Returns the bytes still available.
|
getHost | public String getHost()(Code) | | Returns the stream's host.
|
getPort | public int getPort()(Code) | | Returns the stream's port.
|
isSSL | public boolean isSSL()(Code) | | Set if this should be an SSL connection.
|
openReadWrite | static HttpStreamWrapper openReadWrite(HttpPath path) throws IOException(Code) | | Opens a new HTTP stream for reading and writing, i.e. a POST request.
Parameters: path - the URL for the stream the opened stream |
read | public int read(byte[] buf, int offset, int length) throws IOException(Code) | | Read data from the connection. If the request hasn't yet been sent
to the server, send it.
|
readInt | public int readInt(byte[] buf, int offset, int length) throws IOException(Code) | | Read data from the connection. If the request hasn't yet been sent
to the server, send it.
|
removeAttribute | public void removeAttribute(String name)(Code) | | Remove a header for the request.
|
setAttribute | public void setAttribute(String name, Object value)(Code) | | Sets a header for the request.
|
setHead | public void setHead(boolean isHead)(Code) | | Sets true if we're only interested in the head.
|
setMethod | public void setMethod(String method)(Code) | | Sets the method
|
setSSL | public void setSSL(boolean isSSL)(Code) | | Set if this should be an SSL connection.
|
setSocketTimeout | public void setSocketTimeout(long timeout) throws SocketException(Code) | | Sets the timeout.
|
write | public void write(byte[] buf, int offset, int length, boolean isEnd) throws IOException(Code) | | Writes a buffer to the underlying stream.
Parameters: buffer - the byte array to write. Parameters: offset - the offset into the byte array. Parameters: length - the number of bytes to write. Parameters: isEnd - true when the write is flushing a close. |
Methods inherited from com.caucho.vfs.StreamImpl | public boolean canRead()(Code)(Java Doc) public boolean canWrite()(Code)(Java Doc) public void clearWrite()(Code)(Java Doc) public void close() throws IOException(Code)(Java Doc) public void closeWrite() throws IOException(Code)(Java Doc) public void flush() throws IOException(Code)(Java Doc) public void flushBuffer() throws IOException(Code)(Java Doc) public void flushToDisk() throws IOException(Code)(Java Doc) public Object getAttribute(String name) throws IOException(Code)(Java Doc) public Iterator getAttributeNames() throws IOException(Code)(Java Doc) public int getAvailable() throws IOException(Code)(Java Doc) public boolean getFlushOnNewline()(Code)(Java Doc) public byte[] getNewline()(Code)(Java Doc) public Path getPath()(Code)(Java Doc) public byte[] getReadBuffer()(Code)(Java Doc) public long getReadPosition()(Code)(Java Doc) public boolean hasSkip()(Code)(Java Doc) public int read(byte[] buffer, int offset, int length) throws IOException(Code)(Java Doc) public int readNonBlock(byte[] buffer, int offset, int length) throws IOException(Code)(Java Doc) public int readTimeout(byte[] buffer, int offset, int length, long timeout) throws IOException(Code)(Java Doc) public void removeAttribute(String name) throws IOException(Code)(Java Doc) public void seekEnd(long offset) throws IOException(Code)(Java Doc) public void seekStart(long offset) throws IOException(Code)(Java Doc) public void setAttribute(String name, Object value) throws IOException(Code)(Java Doc) public void setPath(Path path)(Code)(Java Doc) public void setWriteEncoding(String encoding)(Code)(Java Doc) public long skip(long n) throws IOException(Code)(Java Doc) public void write(byte[] buffer, int offset, int length, boolean isEnd) throws IOException(Code)(Java Doc) public boolean write(byte[] buf1, int off1, int len1, byte[] buf2, int off2, int len2, boolean isEnd) throws IOException(Code)(Java Doc)
|
|
|