Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-12-23 04:03:26 -0500
committerslewis2007-12-23 04:03:26 -0500
commit413bb40784eb61a9405cf4c7354276f3b43ebc2a (patch)
tree3c1a209bba0f74b4c0f4065a54620e3f6151c48e
parent7b1323c6c3f844f3562b72cbdf7b8ad6daf1449e (diff)
downloadorg.eclipse.ecf-413bb40784eb61a9405cf4c7354276f3b43ebc2a.tar.gz
org.eclipse.ecf-413bb40784eb61a9405cf4c7354276f3b43ebc2a.tar.xz
org.eclipse.ecf-413bb40784eb61a9405cf4c7354276f3b43ebc2a.zip
Added externalized string and test code
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/plugin.xml8
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Activator.java2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFile.java5
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFileSystemBrowseFactory.java (renamed from providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteBrowse.java)5
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/FileStoreBrowser.java2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Messages.java29
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/messages.properties1
7 files changed, 48 insertions, 4 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/plugin.xml
index d379a9ba2..0720c8b57 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/plugin.xml
@@ -17,4 +17,12 @@
</sendFileTransferProtocolFactory>
</extension>
+ <extension
+ point="org.eclipse.ecf.provider.filetransfer.browseFileTransferProtocolFactory">
+ <browseFileTransferProtocolFactory
+ class="org.eclipse.ecf.internal.provider.filetransfer.efs.EFSRemoteFileSystemBrowseFactory"
+ protocol="efs">
+ </browseFileTransferProtocolFactory>
+ </extension>
+
</plugin>
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Activator.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Activator.java
index 1bad0ec69..0509228db 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Activator.java
@@ -11,7 +11,7 @@ public class Activator extends Plugin {
/**
* Plugin ID
*/
- public static final String PLUGIN_ID = "org.eclipse.ecf.provider.filetransfer.efs";
+ public static final String PLUGIN_ID = "org.eclipse.ecf.provider.filetransfer.efs"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFile.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFile.java
index 7d5708776..8b7d0d2ce 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFile.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFile.java
@@ -54,4 +54,9 @@ public class EFSRemoteFile implements IRemoteFile {
return null;
}
+ public String toString() {
+ final StringBuffer buf = new StringBuffer("EFSRemoteFile["); //$NON-NLS-1$
+ buf.append("name=").append(getInfo().getName()).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
+ return buf.toString();
+ }
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteBrowse.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFileSystemBrowseFactory.java
index 63fb785c4..154c4fbee 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteBrowse.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/EFSRemoteFileSystemBrowseFactory.java
@@ -27,11 +27,12 @@ import org.eclipse.ecf.filetransfer.identity.IFileID;
import org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowser;
import org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowserFactory;
import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace;
+import org.eclipse.osgi.util.NLS;
/**
*
*/
-public class EFSRemoteBrowse implements IRemoteFileSystemBrowserFactory {
+public class EFSRemoteFileSystemBrowseFactory implements IRemoteFileSystemBrowserFactory {
/* (non-Javadoc)
* @see org.eclipse.ecf.filetransfer.service.IRemoteFileSystemBrowserFactory#newInstance()
@@ -56,7 +57,7 @@ public class EFSRemoteBrowse implements IRemoteFileSystemBrowserFactory {
}
final IFileInfo directoryStoreInfo = directoryStore.fetchInfo();
if (!directoryStoreInfo.isDirectory())
- throw new RemoteFileSystemException("{0} is not a directory.");
+ throw new RemoteFileSystemException(NLS.bind(Messages.EFSRemoteFileSystemBrowseFactory_EXCEPTION_NOT_DIRECTORY, directoryID));
final FileStoreBrowser rfs = new FileStoreBrowser(directoryStore, efsDirectory, directoryID, listener);
return rfs.sendDirectoryRequest();
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/FileStoreBrowser.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/FileStoreBrowser.java
index da9ccdd37..cdb495be5 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/FileStoreBrowser.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/FileStoreBrowser.java
@@ -52,7 +52,7 @@ public class FileStoreBrowser extends AbstractFileSystemBrowser {
final IFileInfo[] fileInfos = fileStore.childInfos(EFS.NONE, null);
remoteFiles = new IRemoteFile[fileInfos.length];
for (int i = 0; i < fileInfos.length; i++) {
- remoteFiles[i] = new EFSRemoteFile(FileIDFactory.getDefault().createFileID(directoryID.getNamespace(), new URL(efsDirectory + "/" + fileInfos[i].getName())), fileInfos[i]);
+ remoteFiles[i] = new EFSRemoteFile(FileIDFactory.getDefault().createFileID(directoryID.getNamespace(), new URL(efsDirectory + "/" + fileInfos[i].getName())), fileInfos[i]); //$NON-NLS-1$
}
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Messages.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Messages.java
new file mode 100644
index 000000000..180ae7487
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/Messages.java
@@ -0,0 +1,29 @@
+/****************************************************************************
+ * Copyright (c) 2007 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.internal.provider.filetransfer.efs;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ */
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.ecf.internal.provider.filetransfer.efs.messages"; //$NON-NLS-1$
+ public static String EFSRemoteFileSystemBrowseFactory_EXCEPTION_NOT_DIRECTORY;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/messages.properties b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/messages.properties
new file mode 100644
index 000000000..02ed5737c
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.efs/src/org/eclipse/ecf/internal/provider/filetransfer/efs/messages.properties
@@ -0,0 +1 @@
+EFSRemoteFileSystemBrowseFactory_EXCEPTION_NOT_DIRECTORY={0} is not a directory.

Back to the top