Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-02-28 06:38:52 +0000
committerslewis2009-02-28 06:38:52 +0000
commitea01187ea47a989117bc94a63f02b919ea0752f9 (patch)
tree775cab1c206b26aeb087c3190e3cdea1da0ce53f
parentcd5f7762e766d20b4a280c8d21b77b02665b9a62 (diff)
downloadorg.eclipse.ecf-ea01187ea47a989117bc94a63f02b919ea0752f9.tar.gz
org.eclipse.ecf-ea01187ea47a989117bc94a63f02b919ea0752f9.tar.xz
org.eclipse.ecf-ea01187ea47a989117bc94a63f02b919ea0752f9.zip
Fixes for bug 266140 with additional tests
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
index dc881c282..ee5b01b6d 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient/src/org/eclipse/ecf/provider/filetransfer/httpclient/HttpClientRetrieveFileTransfer.java
@@ -26,7 +26,6 @@ import org.eclipse.core.runtime.*;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.security.*;
import org.eclipse.ecf.core.util.*;
-import org.eclipse.ecf.core.util.Proxy;
import org.eclipse.ecf.filetransfer.*;
import org.eclipse.ecf.filetransfer.events.IFileTransferConnectStartEvent;
import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource;
@@ -540,7 +539,8 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
protected static String getHostFromURL(String url) {
String result = url;
final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$
-
+ if (colonSlashSlash < 0)
+ return ""; //$NON-NLS-1$
if (colonSlashSlash >= 0) {
result = url.substring(colonSlashSlash + 3);
}
@@ -565,6 +565,8 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
protected static int getPortFromURL(String url) {
final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$
+ if (colonSlashSlash < 0)
+ return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT;
final int colonPort = url.indexOf(':', colonSlashSlash + 1);
if (colonPort < 0)
return urlUsesHttps(url) ? HTTPS_PORT : HTTP_PORT;
@@ -582,6 +584,8 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
protected static String getPathFromURL(String url) {
final int colonSlashSlash = url.indexOf("://"); //$NON-NLS-1$
+ if (colonSlashSlash < 0)
+ return "/"; //$NON-NLS-1$
final int requestPath = url.indexOf('/', colonSlashSlash + 3);
if (requestPath < 0)
return "/"; //$NON-NLS-1$

Back to the top