Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-07 15:28:26 +0000
committerEike Stepper2012-09-07 15:28:26 +0000
commit3d0843880e6b3fd11a55da1980af4f74e0406975 (patch)
tree498f302a6645b7042a55c5010dee212f10edd734 /plugins/org.eclipse.emf.cdo.transfer.workspace/src
parente1d1095477205cff8cf522e7127fcfa2d88b769b (diff)
downloadcdo-3d0843880e6b3fd11a55da1980af4f74e0406975.tar.gz
cdo-3d0843880e6b3fd11a55da1980af4f74e0406975.tar.xz
cdo-3d0843880e6b3fd11a55da1980af4f74e0406975.zip
[388928] Develop a resource transfer framework
https://bugs.eclipse.org/bugs/show_bug.cgi?id=388928
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.transfer.workspace/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java b/plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java
index b257667c9c..c71312d0a9 100644
--- a/plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java
+++ b/plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.transfer.CDOTransferElement;
import org.eclipse.emf.cdo.transfer.CDOTransferSystem;
import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.emf.common.util.URI;
@@ -26,7 +27,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import java.io.IOException;
import java.io.InputStream;
/**
@@ -81,7 +81,18 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
@Override
- public void createFolder(IPath path) throws IOException
+ public CDOTransferElement getElement(URI uri)
+ {
+ if (uri.isPlatformResource())
+ {
+ return getElement(uri.path());
+ }
+
+ return null;
+ }
+
+ @Override
+ public void createFolder(IPath path)
{
try
{
@@ -90,12 +101,12 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
catch (CoreException ex)
{
- throw new IOException(ex);
+ throw new IORuntimeException(ex);
}
}
@Override
- public void createBinary(IPath path, InputStream source) throws IOException
+ public void createBinary(IPath path, InputStream source)
{
try
{
@@ -104,12 +115,12 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
catch (CoreException ex)
{
- throw new IOException(ex);
+ throw new IORuntimeException(ex);
}
}
@Override
- public void createText(IPath path, InputStream source, String encoding) throws IOException
+ public void createText(IPath path, InputStream source, String encoding)
{
try
{
@@ -119,7 +130,7 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
catch (CoreException ex)
{
- throw new IOException(ex);
+ throw new IORuntimeException(ex);
}
}
@@ -161,7 +172,7 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
@Override
- protected CDOTransferElement[] doGetChildren() throws IOException
+ protected CDOTransferElement[] doGetChildren()
{
try
{
@@ -178,12 +189,12 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
catch (CoreException ex)
{
- throw new IOException(ex);
+ throw new IORuntimeException(ex);
}
}
@Override
- protected InputStream doOpenInputStream() throws IOException
+ protected InputStream doOpenInputStream()
{
try
{
@@ -191,12 +202,12 @@ public class WorkspaceTransferSystem extends CDOTransferSystem
}
catch (CoreException ex)
{
- throw new IOException(ex);
+ throw new IORuntimeException(ex);
}
}
// @Override
- // protected OutputStream doOpenOutputStream() throws IOException
+ // protected OutputStream doOpenOutputStream()
// {
// return new ByteArrayOutputStream()
// {

Back to the top