You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/08/08 23:51:36 UTC
cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods DeleteMethod.java GetMethod.java HeadMethod.java OptionsMethod.java PostMethod.java PutMethod.java package.html
jsdever 2002/08/08 14:51:36
Modified: httpclient/src/java/org/apache/commons/httpclient/methods
DeleteMethod.java GetMethod.java HeadMethod.java
OptionsMethod.java PostMethod.java PutMethod.java
package.html
Log:
Add @since tags.
Revision Changes Path
1.7 +11 -3 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/DeleteMethod.java
Index: DeleteMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/DeleteMethod.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DeleteMethod.java 28 Jul 2002 18:08:58 -0000 1.6
+++ DeleteMethod.java 8 Aug 2002 21:51:36 -0000 1.7
@@ -71,6 +71,8 @@
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @author <a href="mailto:bcholmes@apache.org">B.C. Holmes</a>
+ *
+ * @since 1.0
*/
public class DeleteMethod
extends HttpMethodBase {
@@ -81,6 +83,8 @@
/**
* No-arg constructor.
+ *
+ * @since 1.0
*/
public DeleteMethod() {
}
@@ -89,6 +93,8 @@
/**
* Path-setting constructor.
* @param path the path to request
+ *
+ * @since 1.0
*/
public DeleteMethod(String path) {
super(path);
@@ -100,6 +106,8 @@
/**
* Returns <tt>"DELETE"</tt>.
* @return <tt>"DELETE"</tt>
+ *
+ * @since 2.0
*/
public String getName() {
return "DELETE";
1.15 +50 -8 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/GetMethod.java
Index: GetMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/GetMethod.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- GetMethod.java 30 Jul 2002 03:01:47 -0000 1.14
+++ GetMethod.java 8 Aug 2002 21:51:36 -0000 1.15
@@ -86,6 +86,8 @@
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @author Sung-Gu Park
* @author Sean C. Sullivan
+ *
+ * @since 1.0
*/
public class GetMethod extends HttpMethodBase {
@@ -102,6 +104,8 @@
/**
* No-arg constructor.
+ *
+ * @since 1.0
*/
public GetMethod() {
setFollowRedirects(true);
@@ -111,6 +115,8 @@
/**
* Path-setting constructor.
* @param path the path to request
+ *
+ * @since 1.0
*/
public GetMethod(String path) {
super(path);
@@ -123,6 +129,8 @@
* Constructor.
* @param path the path to request
* @param tempDir the directory in which to store temporary files
+ *
+ * @since 1.0
*/
public GetMethod(String path, String tempDir) {
super(path);
@@ -137,6 +145,8 @@
* @param path the path to request
* @param tempDir the directory in which to store temporary files
* @param tempFile the file (under tempDir) to buffer contents to
+ *
+ * @since 1.0
*/
public GetMethod(String path, String tempDir, String tempFile) {
super(path);
@@ -151,6 +161,8 @@
* Constructor.
* @param path the path to request
* @param tempFile the file to buffer contents to
+ *
+ * @since 1.0
*/
public GetMethod(String path, File fileData) {
this(path);
@@ -200,6 +212,8 @@
*
* @param useDisk If true the entire response will be buffered in a
* temporary file.
+ *
+ * @since 1.0
*/
public void setUseDisk(boolean useDisk) {
checkNotUsed();
@@ -212,6 +226,8 @@
*
* @param boolean If true the entire response will be buffered in a
* temporary file.
+ *
+ * @since 1.0
*/
public boolean getUseDisk() {
return useDisk;
@@ -221,6 +237,8 @@
* Temporary directory setter.
*
* @param tempDir New value of tempDir
+ *
+ * @since 1.0
*/
public void setTempDir(String tempDir) {
checkNotUsed();
@@ -231,6 +249,8 @@
/**
* Temporary directory getter.
+ *
+ * @since 1.0
*/
public String getTempDir() {
return tempDir;
@@ -241,6 +261,8 @@
* Temporary file setter.
*
* @param tempFile New value of tempFile
+ *
+ * @since 1.0
*/
public void setTempFile(String tempFile) {
checkNotUsed();
@@ -250,6 +272,8 @@
/**
* Temporary file getter.
+ *
+ * @since 1.0
*/
public String getTempFile() {
return tempFile;
@@ -258,6 +282,8 @@
/**
* File data getter.
+ *
+ * @since 1.0
*/
public File getFileData() {
return fileData;
@@ -266,6 +292,8 @@
/**
* File data setter.
+ *
+ * @since 1.0
*/
public void setFileData(File fileData) {
checkNotUsed();
@@ -278,13 +306,19 @@
/**
* Returns <tt>"GET"</tt>.
* @return <tt>"GET"</tt>
+ *
+ * @since 2.0
*/
public String getName() {
return "GET";
}
- // override recycle to reset redirects default
+ /**
+ * Override recycle to reset redirects default.
+ *
+ * @since 1.0
+ */
public void recycle() {
log.trace("enter GetMethod.recycle()");
@@ -295,10 +329,12 @@
}
/**
- * Return my response body, if any,
- * as a byte array.
- * Otherwise return <tt>null</tt>.
- */
+ * Return my response body, if any,
+ * as a byte array.
+ * Otherwise return <tt>null</tt>.
+ *
+ * @since 2.0
+ */
public byte[] getResponseBody() {
log.trace("enter GetMethod.getResponseBody()");
@@ -330,6 +366,8 @@
* Return my response body, if any,
* as a {@link String}.
* Otherwise return <tt>null</tt>.
+ *
+ * @since 2.0
*/
public String getResponseBodyAsString() {
log.trace("enter GetMethod.getResponseBodyAsString()");
@@ -347,6 +385,8 @@
* Return my response body, if any,
* as an {@link InputStream}.
* Otherwise return <tt>null</tt>.
+ *
+ * @since 2.0
*/
public InputStream getResponseBodyAsStream()
throws IOException {
@@ -370,6 +410,8 @@
/**
* Overrides method in {@link HttpMethodBase} to
* write data to the appropriate buffer.
+ *
+ * @since 2.0
*/
protected void readResponseBody(HttpState state, HttpConnection conn)
throws IOException {
1.10 +17 -4 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java
Index: HeadMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/HeadMethod.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- HeadMethod.java 28 Jul 2002 18:08:59 -0000 1.9
+++ HeadMethod.java 8 Aug 2002 21:51:36 -0000 1.10
@@ -77,6 +77,8 @@
* HEAD Method.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ *
+ * @since 1.0
*/
public class HeadMethod
extends HttpMethodBase {
@@ -87,6 +89,8 @@
/**
* No-arg constructor.
+ *
+ * @since 1.0
*/
public HeadMethod() {
setFollowRedirects(true);
@@ -96,6 +100,8 @@
/**
* Path-setting constructor.
* @param path the path to request
+ *
+ * @since 1.0
*/
public HeadMethod(String path) {
super(path);
@@ -106,7 +112,10 @@
// ---------------------------------------------------------------- Methods
- // override recycle to reset redirects default
+ /** Override recycle to reset redirects default.
+ *
+ * @since 1.0
+ */
public void recycle() {
super.recycle();
setFollowRedirects(true);
@@ -118,6 +127,8 @@
/**
* Returns <tt>"HEAD"</tt>.
* @return <tt>"HEAD"</tt>
+ *
+ * @since 2.0
*/
public String getName() {
return "HEAD";
@@ -128,6 +139,8 @@
* <i>not</i> read a response body, despite the
* presence of a <tt>Content-Length</tt> or
* <tt>Transfer-Encoding</tt> header.
+ *
+ * @since 2.0
*/
protected void readResponseBody(HttpState state, HttpConnection conn)
throws IOException, HttpException {
1.8 +23 -3 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/OptionsMethod.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- OptionsMethod.java 28 Jul 2002 18:08:59 -0000 1.7
+++ OptionsMethod.java 8 Aug 2002 21:51:36 -0000 1.8
@@ -78,6 +78,8 @@
* OPTIONS Method.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ *
+ * @since 1.0
*/
public class OptionsMethod
extends HttpMethodBase {
@@ -93,6 +95,8 @@
/**
* Method constructor.
+ *
+ * @since 1.0
*/
public OptionsMethod() {
}
@@ -100,6 +104,8 @@
/**
* Method constructor.
+ *
+ * @since 1.0
*/
public OptionsMethod(String path) {
super(path);
@@ -117,6 +123,10 @@
// --------------------------------------------------------- Public Methods
+ /**
+ *
+ * @since 2.0
+ */
public String getName() {
return "OPTIONS";
}
@@ -124,6 +134,8 @@
/**
* Is the specified method allowed ?
+ *
+ * @since 1.0
*/
public boolean isAllowed(String method) {
checkUsed();
@@ -133,6 +145,8 @@
/**
* Get a list of allowed methods.
+ *
+ * @since 1.0
*/
public Enumeration getAllowedMethods() {
checkUsed();
@@ -142,6 +156,10 @@
// ----------------------------------------------------- HttpMethod Methods
+ /**
+ *
+ * @since 2.0
+ */
protected void processResponseHeaders(HttpState state, HttpConnection conn) {
log.trace("enter OptionsMethod.processResponseHeaders(HttpState, HttpConnection)");
@@ -162,6 +180,8 @@
* Return true if the method needs a content-length header in the request.
*
* @return true if a content-length header will be expected by the server
+ *
+ * @since 1.0
*/
public boolean needContentLength() {
return false;
1.16 +65 -10 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PostMethod.java
Index: PostMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PostMethod.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- PostMethod.java 28 Jul 2002 18:08:59 -0000 1.15
+++ PostMethod.java 8 Aug 2002 21:51:36 -0000 1.16
@@ -97,10 +97,12 @@
* </ul>
* </blockquote>
*
- * @author <a href="mailto:jsdever@sympatico.ca">Jeffrey Dever</a>
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
* @author <a href="mailto:dsale@us.britannica.com">Doug Sale</a>
+ * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a>
* @author Ortwin Gl�ck
+ *
+ * @since 1.0
*/
public class PostMethod extends GetMethod {
/**
@@ -120,6 +122,8 @@
/**
* No-arg constructor.
+ *
+ * @since 1.0
*/
public PostMethod() {
super();
@@ -129,6 +133,8 @@
/**
* Path-setting constructor.
* @param path the path to request
+ *
+ * @since 1.0
*/
public PostMethod(String path) {
super(path);
@@ -139,6 +145,8 @@
* Path and temp directory constructor.
* @param path the path to request
* @param tempDir directory to store temp files in
+ *
+ * @since 1.0
*/
public PostMethod(String path, String tempDir) {
super(path, tempDir);
@@ -150,6 +158,8 @@
* @param path the path to request
* @param tempDir directory to store temp files in
* @param tempFile file to store temporary data in
+ *
+ * @since 1.0
*/
public PostMethod(String path, String tempDir, String tempFile) {
super(path, tempDir, tempFile);
@@ -162,6 +172,8 @@
/**
* Returns <tt>"POST"</tt>.
* @return <tt>"POST"</tt>
+ *
+ * @since 2.0
*/
public String getName() {
return "POST";
@@ -172,6 +184,8 @@
* Overrides method of {@link org.apache.commons.httpclient.HttpMethodBase}.
* @return true if request is buffered and <code>setFollowRedirects</code>
* was set to <code>true</code>.
+ *
+ * @since 2.0
*/
public boolean getFollowRedirects() {
if (!super.getFollowRedirects()) return false;
@@ -182,6 +196,8 @@
/**
* Override method of {@link org.apache.commons.httpclient.HttpMethodBase}
* to clear my request body.
+ *
+ * @since 1.0
*/
public void recycle() {
log.trace("enter PostMethod.recycle()");
@@ -197,7 +213,10 @@
* Does not preserve the initial insertion order.
*
* @throws IllegalStateException if my request body has already been generated.
- * @deprecated use #removeParameter followed by #setParameter
+ * @deprecated use {@link #removeParameter(String,String)} followed by
+ * {@link #addParameter(String,String)}.
+ *
+ * @since 2.0
*/
public void setParameter(String parameterName, String parameterValue) {
log.trace("enter PostMethod.setParameter(String, String)");
@@ -223,8 +242,7 @@
* will be used. In this case the user is responsible to supply the correct
* content length.
*
- *
- *
+ * @since 2.0
*/
public void setRequestContentLength(int length) {
log.trace("enter PostMethod.setRequestContentLength(int)");
@@ -242,6 +260,8 @@
* @param paramValue The parameter value to add.
* @throws IllegalStateException if my request body has already been generated.
* @throws IllegalArgumentException if either argument is null
+ *
+ * @since 1.0
*/
public void addParameter(String paramName, String paramValue) {
log.trace("enter PostMethod.addParameter(String, String)");
@@ -264,6 +284,7 @@
* @throws IllegalStateException if my request body has already been generated.
* @throws IllegalArgumentException if the argument is null or contains null values
* @see #addParameter(String,String)
+ *
* @since 2.0
*/
public void addParameter(NameValuePair param) {
@@ -286,6 +307,7 @@
* @param parameter The array of parameters to add.
* @throws IllegalStateException if my request body has already been generated.
* @see #addParameter(org.apache.commons.httpclient.NameValuePair)
+ *
* @since 2.0
*/
public void addParameters(NameValuePair[] parameters) {
@@ -312,6 +334,7 @@
*
* @return If a parameter exists with the name argument, the coresponding
* NameValuePair is returned. Otherwise null.
+ *
* @since 2.0
*/
public NameValuePair getParameter(String paramName){
@@ -341,6 +364,7 @@
*
* @return An array of the current parameters
* @see #getParameter(java.lang.String)
+ *
* @since 2.0
*/
public NameValuePair[] getParameters(){
@@ -364,6 +388,8 @@
* @param paramName The parameter name to remove.
* @return true if at least one parameter was removed
* @throws IllegalStateException if my request body has already been generated.
+ *
+ * @since 2.0
*/
public boolean removeParameter(String paramName) {
log.trace("enter PostMethod.removeParameter(String)");
@@ -395,6 +421,8 @@
* @param paramValue The parameter value to remove.
* @return true if a parameter was removed.
* @throws IllegalStateException if my request body has already been generated.
+ *
+ * @since 2.0
*/
public boolean removeParameter(String paramName, String paramValue) {
log.trace("enter PostMethod.removeParameter(String, String)");
@@ -424,7 +452,9 @@
*
* @throws IllegalStateException if request params have been added
* @deprecated This method converts characters to bytes in a platform dependent
- * encoding. Use setRequestBody(InputStream) instead.
+ * encoding. Use {@link #setRequestBody(java.io.InputStream)} instead.
+ *
+ * @since 2.0
*/
public void setRequestBody(String body) {
log.trace("enter PostMethod.setRequestBody(String)");
@@ -435,6 +465,16 @@
requestBody = new ByteArrayInputStream(body.getBytes());
}
+ /**
+ * Sets the request body to be the specified inputstream.
+ *
+ * <p>Once this method has been invoked, the request parameters
+ * cannot be altered until I am {@link #recycle recycled}.
+ *
+ * @throws IllegalStateException if request params have been added
+ *
+ * @since 2.0
+ */
public void setRequestBody(InputStream body) {
log.trace("enter PostMethod.getRequestBody(InputStream)");
@@ -449,6 +489,7 @@
*
* @return The request body if it has been set. The generated
* request body from the paramters if they exist. Null otherwise.
+ *
* @since 2.0
*/
public InputStream getRequestBody() {
@@ -464,7 +505,9 @@
}
/**
- *@return the request body as a string
+ * @return the request body as a string
+ *
+ * @since 2.0
*/
public String getRequestBodyAsString() throws IOException{
log.trace("enter PostMethod.getRequestBodyAsString()");
@@ -484,6 +527,8 @@
* Override method of {@link org.apache.commons.httpclient.HttpMethodBase} to
* also add <tt>Content-Type</tt> header
* when appropriate.
+ *
+ * @since 2.0
*/
protected void addRequestHeaders(HttpState state, HttpConnection conn)
throws IOException, HttpException {
@@ -493,6 +538,7 @@
}
}
+
/**
* Override method of {@link org.apache.commons.httpclient.HttpMethodBase}
* to write request parameters as the request body.
@@ -504,6 +550,8 @@
* cannot be altered until I am {@link #recycle recycled}.
*
* @return always returns true
+ *
+ * @since 2.0
*/
protected boolean writeRequestBody(HttpState state, HttpConnection conn)
throws IOException, HttpException {
@@ -540,11 +588,14 @@
return true;
}
+
/**
* Override method of {@link org.apache.commons.httpclient.HttpMethodBase}
* to return the length of the request body.
*
- @return number of bytes in the request body
+ * @return number of bytes in the request body
+ *
+ * @since 2.0
*/
protected int getRequestContentLength() {
log.trace("enter PostMethod.getRequestContentLength()");
@@ -566,6 +617,8 @@
/**
* Buffers the request body and calculates the content length.
* If the method was called earlier it returns immediately.
+ *
+ * @since 1.0
*/
private void bufferContent() {
log.trace("enter PostMethod.bufferContent()");
@@ -596,6 +649,8 @@
*
* TODO: consider moving this out into URIUtil.
* @return urlencoded string
+ *
+ * @since 1.0
*/
static InputStream generateRequestBody(List params) {
log.trace("enter PostMethod.generateRequestBody(List)");
1.13 +29 -3 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java
Index: PutMethod.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- PutMethod.java 28 Jul 2002 18:08:59 -0000 1.12
+++ PutMethod.java 8 Aug 2002 21:51:36 -0000 1.13
@@ -84,6 +84,8 @@
* PUT Method.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
+ *
+ * @since 1.0
*/
public class PutMethod extends HttpMethodBase {
@@ -93,6 +95,8 @@
/**
* No-arg constructor.
+ *
+ * @since 1.0
*/
public PutMethod() {
setFollowRedirects(false);
@@ -102,6 +106,8 @@
/**
* Path-setting constructor.
* @param path the path to request
+ *
+ * @since 1.0
*/
public PutMethod(String path) {
super(path);
@@ -135,6 +141,8 @@
/**
* Return <tt>"PUT"</tt>.
* @return <tt>"PUT"</tt>
+ *
+ * @since 2.0
*/
public String getName() {
return "PUT";
@@ -142,6 +150,8 @@
/**
* Set my request body content to the contents of a file.
+ *
+ * @since 2.0
*/
public void setRequestBody(File file) throws IOException {
checkNotUsed();
@@ -150,6 +160,8 @@
/**
* Set my request body content to the resource at the specified URL.
+ *
+ * @since 2.0
*/
public void setRequestBody(URL url) throws IOException {
checkNotUsed();
@@ -158,6 +170,8 @@
/**
* Set my request body content to the contents of a byte array.
+ *
+ * @since 2.0
*/
public void setRequestBody(byte[] bodydata) {
checkNotUsed();
@@ -166,6 +180,8 @@
/**
* Set my request body content to the contents of a string.
+ *
+ * @since 2.0
*/
public void setRequestBody(String bodydata) {
checkNotUsed();
@@ -177,6 +193,8 @@
* The contents will be buffered into
* memory. To upload large entities, it is recommended to first buffer the
* data into a temporary file, and then send that file.
+ *
+ * @since 2.0
*/
public void setRequestBody(InputStream is)
throws IOException {
@@ -204,6 +222,8 @@
* to set the <tt>Expect</tt> header if it has
* not already been set, in addition to the "standard"
* set of headers.
+ *
+ * @since 2.0
*/
protected void addRequestHeaders(HttpState state, HttpConnection conn)
throws IOException, HttpException {
@@ -221,6 +241,8 @@
* to not send any data until
* the <tt>100 Continue</tt> status has not be
* read.
+ *
+ * @since 2.0
*/
protected boolean writeRequestBody(HttpState state, HttpConnection conn)
throws IOException, HttpException {
@@ -259,6 +281,8 @@
/**
* Override the method of {@link HttpMethodBase}
* to return the appropriate content length.
+ *
+ * @since 2.0
*/
protected int getRequestContentLength() {
log.trace("enter PutMethod.getRequestContentLength()");
@@ -275,6 +299,8 @@
}
/**
+ *
+ * @since 1.0
*/
public void recycle() {
super.recycle();
1.3 +3 -1 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/package.html
Index: package.html
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/methods/package.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- package.html 4 Oct 2001 17:49:15 -0000 1.2
+++ package.html 8 Aug 2002 21:51:36 -0000 1.3
@@ -5,5 +5,7 @@
</head>
<body>
Classes implementing {@link org.apache.commons.httpclient.HttpMethod} for the base HTTP methods.
+
+ @since 1.0
</body>
</html>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>