本文整理了Java中org.apache.commons.httpclient.HttpConnection.assertOpen()
方法的一些代码示例,展示了HttpConnection.assertOpen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpConnection.assertOpen()
方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpConnection
类名称:HttpConnection
方法名:assertOpen
[英]Throws an IllegalStateException if the connection is not open.
[中]如果连接未打开,则引发IllegalStateException。
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Sets <code>SO_TIMEOUT</code> value directly on the underlying {@link Socket socket}.
* This method does not change the default read timeout value set via
* {@link HttpConnectionParams}.
*
* @param timeout the timeout value
* @throws SocketException - if there is an error in the underlying
* protocol, such as a TCP error.
* @throws IllegalStateException if not connected
*
* @since 3.0
*/
public void setSocketTimeout(int timeout)
throws SocketException, IllegalStateException {
assertOpen();
if (this.socket != null) {
this.socket.setSoTimeout(timeout);
}
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Reads up to <tt>"\n"</tt> from the (unchunked) input stream.
* If the stream ends before the line terminator is found,
* the last part of the string will still be returned.
*
* @throws IllegalStateException if the connection is not open
* @throws IOException if an I/O problem occurs
* @return a line from the response
*
* @deprecated use #readLine(String)
*/
public String readLine() throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.readLine()");
assertOpen();
return HttpParser.readLine(inputStream);
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Writes <i>length</i> bytes in <i>data</i> starting at
* <i>offset</i> to the output stream.
*
* The general contract for
* write(b, off, len) is that some of the bytes in the array b are written
* to the output stream in order; element b[off] is the first byte written
* and b[off+len-1] is the last byte written by this operation.
*
* @param data array containing the data to be written.
* @param offset the start offset in the data.
* @param length the number of bytes to write.
* @throws IllegalStateException if not connected
* @throws IOException if an I/O problem occurs
*/
public void write(byte[] data, int offset, int length)
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.write(byte[], int, int)");
if (offset < 0) {
throw new IllegalArgumentException("Array offset may not be negative");
}
if (length < 0) {
throw new IllegalArgumentException("Array length may not be negative");
}
if (offset + length > data.length) {
throw new IllegalArgumentException("Given offset and length exceed the array length");
}
assertOpen();
this.outputStream.write(data, offset, length);
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Reads up to <tt>"\n"</tt> from the (unchunked) input stream.
* If the stream ends before the line terminator is found,
* the last part of the string will still be returned.
*
* @param charset the charset to use for reading the data
*
* @throws IllegalStateException if the connection is not open
* @throws IOException if an I/O problem occurs
* @return a line from the response
*
* @since 3.0
*/
public String readLine(final String charset) throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.readLine()");
assertOpen();
return HttpParser.readLine(inputStream, charset);
}
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Returns an {@link OutputStream} suitable for writing the request.
*
* @throws IllegalStateException if the connection is not open
* @throws IOException if an I/O problem occurs
* @return a stream to write the request to
*/
public OutputStream getRequestOutputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getRequestOutputStream()");
assertOpen();
OutputStream out = this.outputStream;
if (Wire.CONTENT_WIRE.enabled()) {
out = new WireLogOutputStream(out, Wire.CONTENT_WIRE);
}
return out;
}
代码示例来源:origin: commons-httpclient/commons-httpclient
throws IOException {
LOG.trace("enter HttpConnection.isResponseAvailable(int)");
assertOpen();
boolean result = false;
if (this.inputStream.available() > 0) {
代码示例来源:origin: org.mule.transports/mule-transport-http
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.zaproxy/zap
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Return a {@link InputStream} suitable for reading the response.
* @return InputStream The response input stream.
* @throws IOException If an IO problem occurs
* @throws IllegalStateException If the connection isn't open.
*/
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
LOG.trace("enter HttpConnection.getResponseInputStream()");
assertOpen();
return inputStream;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: org.mule.transports/mule-transport-http
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: org.zaproxy/zap
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Flushes the output request stream. This method should be called to
* ensure that data written to the request OutputStream is sent to the server.
*
* @throws IOException if an I/O problem occurs
*/
public void flushRequestOutputStream() throws IOException {
LOG.trace("enter HttpConnection.flushRequestOutputStream()");
assertOpen();
outputStream.flush();
}
内容来源于网络,如有侵权,请联系作者删除!