Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-12-12 22:11:55 +0000
committerslewis2007-12-12 22:11:55 +0000
commitaa00f8f3bded5c7dcad8273eb06fb1fee7d65b80 (patch)
tree14e612b651229b6632bb35e9a7e5ed0b4e0b9cae /framework/bundles/org.eclipse.ecf
parenteb9e09c5b6d4e2d1dee4b165edd2ce0f28932d1a (diff)
downloadorg.eclipse.ecf-aa00f8f3bded5c7dcad8273eb06fb1fee7d65b80.tar.gz
org.eclipse.ecf-aa00f8f3bded5c7dcad8273eb06fb1fee7d65b80.tar.xz
org.eclipse.ecf-aa00f8f3bded5c7dcad8273eb06fb1fee7d65b80.zip
Additions to file transfer API...specifically addition of two extension points retrieveFileTransferProtocolFactory, and sendFileTransferProtocolFactory for file retrieve, and send, respectively. Also added documentation to online docs.
Diffstat (limited to 'framework/bundles/org.eclipse.ecf')
-rw-r--r--framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java111
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java20
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Messages.java1
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/messages.properties1
5 files changed, 122 insertions, 13 deletions
diff --git a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
index c2233fcf1..85e403b2d 100644
--- a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf;singleton:=true
-Bundle-Version: 1.2.0.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.ecf.internal.core.ECFPlugin
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java
new file mode 100644
index 000000000..c2179a101
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. 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: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.core.security;
+
+import org.eclipse.ecf.internal.core.Messages;
+
+/**
+ * Callback that handles Boolean types
+ *
+ */
+public class BooleanCallback implements Callback, java.io.Serializable {
+
+ private static final long serialVersionUID = 8660509222691671868L;
+
+ private String prompt;
+
+ private boolean defaultValue;
+
+ private boolean value;
+
+ /**
+ * Construct a <code>BooleanCallback</code> with a prompt.
+ *
+ * <p>
+ *
+ * @param prompt
+ * the prompt used to request the boolean value.
+ *
+ * @exception IllegalArgumentException
+ * if <code>prompt</code> is null or if <code>prompt</code>
+ * has a length of 0.
+ */
+ public BooleanCallback(String prompt) {
+ if (prompt == null)
+ throw new IllegalArgumentException(Messages.BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT);
+ this.prompt = prompt;
+ }
+
+ /**
+ * Construct a <code>NameCallback</code> with a prompt and default name.
+ *
+ * <p>
+ *
+ * @param prompt
+ * the prompt used to request the information.
+ * <p>
+ *
+ * @param defaultValue
+ * the value to be used as the default value displayed with the
+ * prompt.
+ *
+ * @exception IllegalArgumentException
+ * if <code>prompt</code> is null.
+ */
+ public BooleanCallback(String prompt, boolean defaultValue) {
+ if (prompt == null)
+ throw new IllegalArgumentException(Messages.BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT);
+
+ this.prompt = prompt;
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Get the prompt.
+ *
+ * @return the prompt value.
+ */
+ public String getPrompt() {
+ return prompt;
+ }
+
+ /**
+ * Get the default value.
+ *
+ * @return the default value, or null if this <code>BooleanCallback</code> was
+ * not instantiated with a <code>defaultValue</code>.
+ */
+ public boolean getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * Set the retrieved name.
+ *
+ * @param val
+ * the retrieved value <code>true</code> or <code>false</code>.
+ *
+ * @see #getValue
+ */
+ public void setValue(boolean val) {
+ this.value = val;
+ }
+
+ /**
+ * Get the retrieved value.
+ *
+ * @return the retrieved value <code>true</code> or <code>false</code>.
+ *
+ * @see #setValue
+ */
+ public boolean getValue() {
+ return value;
+ }
+
+}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java
index 11ddb4dfb..b8bb4d504 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.ecf.core.security;
+import org.eclipse.ecf.internal.core.Messages;
+
/**
* Callback that handles String types
*
@@ -25,18 +27,15 @@ public class NameCallback implements Callback, java.io.Serializable {
/**
* Construct a <code>NameCallback</code> with a prompt.
*
- * <p>
- *
* @param prompt
* the prompt used to request the name.
*
* @exception IllegalArgumentException
- * if <code>prompt</code> is null or if <code>prompt</code>
- * has a length of 0.
+ * if <code>prompt</code> is null.
*/
public NameCallback(String prompt) {
- if (prompt == null || prompt.length() == 0)
- throw new IllegalArgumentException();
+ if (prompt == null)
+ throw new IllegalArgumentException(Messages.BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT);
this.prompt = prompt;
}
@@ -54,14 +53,11 @@ public class NameCallback implements Callback, java.io.Serializable {
* prompt.
*
* @exception IllegalArgumentException
- * if <code>prompt</code> is null, if <code>prompt</code>
- * has a length of 0, if <code>defaultName</code> is null,
- * or if <code>defaultName</code> has a length of 0.
+ * if <code>prompt</code> is null.
*/
public NameCallback(String prompt, String defaultName) {
- if (prompt == null || prompt.length() == 0 || defaultName == null || defaultName.length() == 0)
- throw new IllegalArgumentException();
-
+ if (prompt == null)
+ throw new IllegalArgumentException(Messages.BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT);
this.prompt = prompt;
this.defaultName = defaultName;
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Messages.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Messages.java
index 478f5fb3f..8f1a9f7f9 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Messages.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Messages.java
@@ -16,6 +16,7 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.core.messages"; //$NON-NLS-1$
public static String AbstractContainer_Exception_Callback_Handler;
+ public static String BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT;
public static String ContainerFactory_Base_Container_Name;
public static String ContainerFactory_Exception_Adapter_Not_Null;
public static String ContainerFactory_EXCEPTION_CONTAINER_ID_NOT_NULL;
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/messages.properties b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/messages.properties
index 5e4a19bc0..735fb543f 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/messages.properties
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/messages.properties
@@ -20,3 +20,4 @@ ContainerTypeDescription_Instantiator_Class_Not_Null = ContainerTypeDescription<
ContainerTypeDescription_Instantiator_Instance_Not_Null = ContainerTypeDescription<init> instantiator instance cannot be null
AbstractContainer_Exception_Callback_Handler = Exception in CallbackHandler.handle(<callbacks>)
ECFPlugin_Container_Name_Collision_Prefix = ECF container factory with name {0} already found. Ignoring registration for containerFactory extension point {1}.
+BooleanCallback_EXCEPTION_INVALID_BOOLEAN_ARGUMENT=Prompt cannot be null.

Back to the top