mholz 2004/04/02 11:26:26
Modified: webdavclient/commandline/src/java/org/apache/webdav/cmd
Client.java
Log:
Merge from release branch:
Better error handling for the open command.
Problem reported by Michael Haeusler, see
http://thread.gmane.org/gmane.comp.jakarta.slide.user/4001
Revision Changes Path
1.6 +11 -6
jakarta-slide/webdavclient/commandline/src/java/org/apache/webdav/cmd/Client.java
Index: Client.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/webdavclient/commandline/src/java/org/apache/webdav/cmd/Client.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Client.java 31 Mar 2004 09:45:09 -0000 1.5
+++ Client.java 2 Apr 2004 19:26:25 -0000 1.6
@@ -247,7 +247,7 @@
void setDebug(int level)
{
this.debugLevel=level;
- webdavResource.setDebug(debugLevel);
+ if (webdavResource != null) webdavResource.setDebug(debugLevel);
switch (level) {
case DEBUG_ON: out.println("The debug flag is on."); break;
@@ -1924,7 +1924,12 @@
}
private static HttpURL uriToHttpURL(String uri) throws URIException {
- return uri.startsWith("https") ? new HttpsURL(uri.toCharArray())
- : new HttpURL(uri.toCharArray());
+ if (uri.startsWith("http://")) {
+ return new HttpsURL(uri.toCharArray());
+ }else if (uri.startsWith("https://")) {
+ return new HttpsURL(uri.toCharArray());
+ } else {
+ throw new URIException("Unknown protocol in URL " + uri);
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]