Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-12-21 12:54:20 -0500
committerslewis2007-12-21 12:54:20 -0500
commit157cc646be978189c22e650c7393afd1c1a1a6ef (patch)
tree99ca76b853aa8e2f7a0a180dbcf1855b1f6930e2
parentf5cd97613ea7a8a05960461f6cf68638932c4cc9 (diff)
downloadorg.eclipse.ecf-157cc646be978189c22e650c7393afd1c1a1a6ef.tar.gz
org.eclipse.ecf-157cc646be978189c22e650c7393afd1c1a1a6ef.tar.xz
org.eclipse.ecf-157cc646be978189c22e650c7393afd1c1a1a6ef.zip
Added code for 'file' protocol handling of remote file system browsing.
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.filetransfer/META-INF/MANIFEST.MF3
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.filetransfer/plugin.xml7
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/FileBrowseTestCase.java1
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/RemoteFileSystemBrowserFactory.java45
4 files changed, 55 insertions, 1 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.filetransfer/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.filetransfer/META-INF/MANIFEST.MF
index f634053d8..af33b270f 100755
--- a/tests/bundles/org.eclipse.ecf.tests.filetransfer/META-INF/MANIFEST.MF
+++ b/tests/bundles/org.eclipse.ecf.tests.filetransfer/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Require-Bundle: org.junit,
org.eclipse.ecf,
org.eclipse.ecf.filetransfer,
org.eclipse.ecf.tests,
- org.eclipse.equinox.common
+ org.eclipse.equinox.common,
+ org.eclipse.ecf.provider.filetransfer
Eclipse-LazyStart: true
Import-Package: org.osgi.framework;version="1.4.0",
org.osgi.service.url;version="1.0.0",
diff --git a/tests/bundles/org.eclipse.ecf.tests.filetransfer/plugin.xml b/tests/bundles/org.eclipse.ecf.tests.filetransfer/plugin.xml
index adc4f81a2..4138a37ea 100755
--- a/tests/bundles/org.eclipse.ecf.tests.filetransfer/plugin.xml
+++ b/tests/bundles/org.eclipse.ecf.tests.filetransfer/plugin.xml
@@ -8,5 +8,12 @@
serviceClass="org.eclipse.ecf.tests.filetransfer.URLStreamHandlerServiceTest">
</urlStreamHandlerService>
</extension>
+ <extension
+ point="org.eclipse.ecf.provider.filetransfer.browseFileTransferProtocolFactory">
+ <browseFileTransferProtocolFactory
+ class="org.eclipse.ecf.tests.filetransfer.RemoteFileSystemBrowserFactory"
+ protocol="file">
+ </browseFileTransferProtocolFactory>
+ </extension>
</plugin>
diff --git a/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/FileBrowseTestCase.java b/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/FileBrowseTestCase.java
index 5b2448efb..98d1b5b77 100755
--- a/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/FileBrowseTestCase.java
+++ b/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/FileBrowseTestCase.java
@@ -20,5 +20,6 @@ public class FileBrowseTestCase extends AbstractBrowseTestCase {
public void testFileBrowse() throws Exception {
testListDirectory(new URL("file:///c:/"));
+ Thread.sleep(5000);
}
}
diff --git a/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/RemoteFileSystemBrowserFactory.java b/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/RemoteFileSystemBrowserFactory.java
new file mode 100755
index 000000000..08418fe04
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.filetransfer/src/org/eclipse/ecf/tests/filetransfer/RemoteFileSystemBrowserFactory.java
@@ -0,0 +1,45 @@
+package org.eclipse.ecf.tests.filetransfer;
+
+import java.net.MalformedURLException;
+
+import org.eclipse.ecf.core.identity.IDFactory;
+import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.filetransfer.IRemoteFileSystemListener;
+import org.eclipse.ecf.filetransfer.IRemoteFileSystemRequest;
+import org.eclipse.ecf.filetransfer.RemoteFileSystemException;
+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.browse.FileSystemBrowser;
+import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace;
+
+public class RemoteFileSystemBrowserFactory implements IRemoteFileSystemBrowserFactory {
+
+ public RemoteFileSystemBrowserFactory() {
+ // nothing
+ }
+
+ public IRemoteFileSystemBrowser newInstance() {
+ return new IRemoteFileSystemBrowser() {
+
+ public Namespace getDirectoryNamespace() {
+ return IDFactory.getDefault().getNamespaceByName(FileTransferNamespace.PROTOCOL);
+ }
+
+ public IRemoteFileSystemRequest sendDirectoryRequest(IFileID directoryID, IRemoteFileSystemListener listener) throws RemoteFileSystemException {
+ FileSystemBrowser fsb;
+ try {
+ fsb = new FileSystemBrowser(directoryID, directoryID.getURL(), listener);
+ } catch (final MalformedURLException e) {
+ throw new RemoteFileSystemException("Malformed URL Exception", e);
+ }
+ return fsb.sendDirectoryRequest();
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ };
+ }
+
+}

Back to the top