Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java')
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java66
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java
new file mode 100644
index 0000000000..e35f226007
--- /dev/null
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.internal.http;
+
+import org.eclipse.net4j.connector.ConnectorLocation;
+import org.eclipse.net4j.http.IHTTPConnector;
+
+import java.text.MessageFormat;
+
+/**
+ * @author Eike Stepper
+ */
+public class HTTPClientConnector extends HTTPConnector implements IHTTPConnector
+{
+ private String url;
+
+ public HTTPClientConnector()
+ {
+ }
+
+ public ConnectorLocation getLocation()
+ {
+ return ConnectorLocation.CLIENT;
+ }
+
+ @Override
+ public String getURL()
+ {
+ return url;
+ }
+
+ @Override
+ public void setURL(String url)
+ {
+ this.url = url;
+ }
+
+ @Override
+ public String toString()
+ {
+ if (getUserID() == null)
+ {
+ return MessageFormat.format("HTTPClientConnector[{0}]", getURL()); //$NON-NLS-1$
+ }
+
+ return MessageFormat.format("HTTPClientConnector[{1}@{0}]", getURL(), getUserID()); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void doBeforeActivate() throws Exception
+ {
+ super.doBeforeActivate();
+ if (url == null)
+ {
+ throw new IllegalStateException("url == null");
+ }
+ }
+}

Back to the top