[prev in list] [next in list] [prev in thread] [next in thread]
List: slide-dev
Subject: cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib WebdavResource.java
From: ib () apache ! org
Date: 2003-02-27 13:40:52
[Download RAW message or body]
ib 2003/02/27 05:40:52
Modified: src/webdav/client/src/org/apache/webdav/lib
WebdavResource.java
Log:
Add some constructors to make using a proxy easier
Fix problems with refresh() being called for no longer existing
resources after a MOVE or a DELETE operation
Add an additional labelMethod which takes a destination parameter
Revision Changes Path
1.56 +59 -9 jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavResource.java
Index: WebdavResource.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavResource.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- WebdavResource.java 7 Feb 2003 14:58:57 -0000 1.55
+++ WebdavResource.java 27 Feb 2003 13:40:51 -0000 1.56
@@ -293,6 +293,24 @@
/**
* The constructor.
+ *
+ * @param httpURL The specified http URL.
+ * @param proxyHost The hostname of the proxy to use.
+ * @param proxyPort The port number of the proxy to use.
+ * @exception HttpException
+ * @exception IOException
+ * @see #setDefaultAction(int)
+ */
+ public WebdavResource(HttpURL httpURL, String proxyHost, int proxyPort)
+ throws HttpException, IOException {
+
+ setProxy(proxyHost, proxyPort);
+ setHttpURL(httpURL);
+ }
+
+
+ /**
+ * The constructor.
* It must be put an escaped http URL as an arguement.
*
* @param escapedHttpURL The escaped http URL string.
@@ -309,6 +327,25 @@
/**
* The constructor.
+ * It must be put an escaped http URL as an arguement.
+ *
+ * @param escapedHttpURL The escaped http URL string.
+ * @param proxyHost The hostname of the proxy to use.
+ * @param proxyPort The port number of the proxy to use.
+ * @exception HttpException
+ * @exception IOException
+ * @see #setDefaultAction(int)
+ */
+ public WebdavResource(String escapedHttpURL, String proxyHost,
+ int proxyPort) throws HttpException, IOException {
+
+ setProxy(proxyHost, proxyPort);
+ setHttpURL(escapedHttpURL);
+ }
+
+
+ /**
+ * The constructor.
*
* @param httpURL The http URL.
* @param additionalPath The added relative path.
@@ -2613,6 +2650,15 @@
public boolean labelMethod(String labelname, int type)
throws HttpException, IOException
{
+ return labelMethod(httpURL.getPath(), labelname, type);
+ }
+
+ /**
+ * Execute a LABEL method on the given path, setting the given label
+ */
+ public boolean labelMethod(String path, String labelname, int type)
+ throws HttpException, IOException
+ {
int labeltype=0;
switch(type) {
@@ -2628,8 +2674,7 @@
}
setClient();
- LabelMethod method = new LabelMethod(httpURL.getPath(), labeltype,
- labelname);
+ LabelMethod method = new LabelMethod(path, labeltype, labelname);
int statusCode = client.executeMethod(method);
@@ -3389,7 +3434,9 @@
throws HttpException, IOException {
boolean result = deleteMethod(httpURL.getPath());
- if (result) refresh();
+ if (result) {
+ setExistence(false);
+ }
return result;
}
@@ -3427,9 +3474,12 @@
public boolean moveMethod(String destination)
throws HttpException, IOException {
- boolean result = moveMethod(httpURL.getPath(),
- HttpURL.getPath(destination));
- if (result) refresh();
+ String destinationPath = HttpURL.getPath(destination);
+ boolean result = moveMethod(httpURL.getPath(), destinationPath);
+ if (result) {
+ httpURL.setPath(destinationPath);
+ refresh();
+ }
return result;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic