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
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')
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer.ui/src/org/eclipse/emf/cdo/transfer/ui/widgets/TransferDetailsComposite.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer.workspace/src/org/eclipse/emf/cdo/transfer/spi/workspace/WorkspaceTransferSystem.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/spi/transfer/FileSystemTransferSystem.java53
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferElement.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferSystem.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/TransferTest.java6
9 files changed, 143 insertions, 96 deletions
diff --git a/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java b/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
index 87f3bf7a61..19f37ed956 100644
--- a/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
+++ b/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
@@ -146,6 +146,17 @@ public class RepositoryTransferSystem extends CDOTransferSystem
}
@Override
+ public CDOTransferElement getElement(URI uri)
+ {
+ if (CDOURIUtil.PROTOCOL_NAME.equals(uri.scheme()))
+ {
+ return getElement(uri.path());
+ }
+
+ return null;
+ }
+
+ @Override
public void createFolder(IPath path) throws IOException
{
((CDOTransaction)view).createResourceFolder(path.toString());
diff --git a/plugins/org.eclipse.emf.cdo.transfer.ui/src/org/eclipse/emf/cdo/transfer/ui/widgets/TransferDetailsComposite.java b/plugins/org.eclipse.emf.cdo.transfer.ui/src/org/eclipse/emf/cdo/transfer/ui/widgets/TransferDetailsComposite.java
index b95c8c3258..19e7d58595 100644
--- a/plugins/org.eclipse.emf.cdo.transfer.ui/src/org/eclipse/emf/cdo/transfer/ui/widgets/TransferDetailsComposite.java
+++ b/plugins/org.eclipse.emf.cdo.transfer.ui/src/org/eclipse/emf/cdo/transfer/ui/widgets/TransferDetailsComposite.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.transfer.ui.widgets;
import org.eclipse.emf.cdo.transfer.CDOTransfer;
+import org.eclipse.emf.cdo.transfer.CDOTransferElement;
import org.eclipse.emf.cdo.transfer.CDOTransferMapping;
import org.eclipse.emf.cdo.transfer.CDOTransferType;
@@ -25,6 +26,7 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.swt.SWT;
@@ -42,7 +44,6 @@ import org.eclipse.swt.widgets.Text;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -256,44 +257,8 @@ public class TransferDetailsComposite extends Composite implements IListener
org.eclipse.swt.widgets.List list = unmappedModels.getList();
list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- // unmappedModels = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
- // Table table = unmappedModels.getTable();
- // table.setLinesVisible(true);
- // table.setHeaderVisible(true);
- // table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- //
- // TableViewerColumn uriViewerColumn = new TableViewerColumn(unmappedModels, SWT.NONE);
- // TableColumn uriColumn = uriViewerColumn.getColumn();
- // uriColumn.setWidth(373);
- // uriColumn.setText("URI");
- //
- // TableViewerColumn transformationViewerColumn = new TableViewerColumn(unmappedModels, SWT.NONE);
- // TableColumn transformationColumn = transformationViewerColumn.getColumn();
- // transformationColumn.setWidth(341);
- // transformationColumn.setText("Transformation");
-
- unmappedModels.setContentProvider(new StructuredContentProvider<CDOTransfer>()
- {
- public Object[] getElements(Object inputElement)
- {
- CDOTransfer transfer = getInput();
- Set<Resource> resources = transfer.getModelTransferContext().resolve();
-
- int size = resources.size();
- URI[] uris = new URI[size];
-
- Iterator<Resource> it = resources.iterator();
- for (int i = 0; i < size; i++)
- {
- Resource resource = it.next();
- uris[i] = resource.getURI();
- }
-
- return uris;
- }
- });
-
- unmappedModels.setLabelProvider(new LabelProvider());
+ unmappedModels.setContentProvider(new UnmappedModelsContentProvider());
+ unmappedModels.setLabelProvider(new UnmappedModelsLabelProvider());
unmappedModels.setInput(transfer);
GridLayout transformationButtonsPaneLayout = new GridLayout(1, false);
@@ -313,7 +278,12 @@ public class TransferDetailsComposite extends Composite implements IListener
@Override
public void widgetSelected(SelectionEvent e)
{
+ IStructuredSelection selection = (IStructuredSelection)unmappedModels.getSelection();
+ Resource resource = (Resource)selection.getFirstElement();
+ URI uri = resource.getURI();
+ CDOTransferElement element = transfer.getSourceSystem().getElement(uri);
+ transfer.map(element);
}
});
@@ -460,4 +430,34 @@ public class TransferDetailsComposite extends Composite implements IListener
}
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class UnmappedModelsContentProvider extends StructuredContentProvider<CDOTransfer>
+ {
+ public Object[] getElements(Object inputElement)
+ {
+ CDOTransfer transfer = getInput();
+ Set<Resource> resources = transfer.getModelTransferContext().resolve();
+ return resources.toArray(new Resource[resources.size()]);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class UnmappedModelsLabelProvider extends LabelProvider
+ {
+ @Override
+ public String getText(Object element)
+ {
+ if (element instanceof Resource)
+ {
+ Resource resource = (Resource)element;
+ return resource.getURI().toString();
+ }
+ return super.getText(element);
+ }
+ }
}
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()
// {
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/spi/transfer/FileSystemTransferSystem.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/spi/transfer/FileSystemTransferSystem.java
index fe255280a1..29abe67eaa 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/spi/transfer/FileSystemTransferSystem.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/spi/transfer/FileSystemTransferSystem.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.spi.transfer;
import org.eclipse.emf.cdo.transfer.CDOTransferElement;
import org.eclipse.emf.cdo.transfer.CDOTransferSystem;
+import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.emf.common.util.URI;
@@ -68,24 +69,40 @@ public class FileSystemTransferSystem extends CDOTransferSystem
}
@Override
- public void createFolder(IPath path) throws IOException
+ public CDOTransferElement getElement(URI uri)
+ {
+ if (uri.isFile())
+ {
+ return getElement(uri.path());
+ }
+
+ return null;
+ }
+
+ @Override
+ public void createFolder(IPath path)
{
File file = getFile(path);
mkDir(file);
}
@Override
- public void createBinary(IPath path, InputStream source) throws IOException
+ public void createBinary(IPath path, InputStream source)
{
File file = getFile(path);
mkParent(file);
- OutputStream target = new FileOutputStream(file);
+ OutputStream target = null;
try
{
+ target = new FileOutputStream(file);
IOUtil.copy(source, target);
}
+ catch (IOException ex)
+ {
+ throw new IORuntimeException();
+ }
finally
{
IOUtil.close(target);
@@ -93,17 +110,22 @@ public class FileSystemTransferSystem extends CDOTransferSystem
}
@Override
- public void createText(IPath path, InputStream source, String encoding) throws IOException
+ public void createText(IPath path, InputStream source, String encoding)
{
File file = getFile(path);
mkParent(file);
- Writer target = new FileWriter(file);
+ Writer target = null;
try
{
+ target = new FileWriter(file);
IOUtil.copyCharacter(new InputStreamReader(source, encoding), target);
}
+ catch (IOException ex)
+ {
+ throw new IORuntimeException();
+ }
finally
{
IOUtil.close(target);
@@ -121,7 +143,7 @@ public class FileSystemTransferSystem extends CDOTransferSystem
return new File(path.toOSString());
}
- protected void mkParent(File file) throws IOException
+ protected void mkParent(File file)
{
File parent = file.getParentFile();
if (parent != null)
@@ -130,20 +152,20 @@ public class FileSystemTransferSystem extends CDOTransferSystem
}
}
- protected void mkDir(File file) throws IOException
+ protected void mkDir(File file)
{
if (file.exists())
{
if (!file.isDirectory())
{
- throw new IOException("Not a folder " + file);
+ throw new IORuntimeException("Not a folder " + file);
}
}
else
{
if (!file.mkdirs())
{
- throw new IOException("Could not create folder " + file);
+ throw new IORuntimeException("Could not create folder " + file);
}
}
}
@@ -180,7 +202,7 @@ public class FileSystemTransferSystem extends CDOTransferSystem
}
@Override
- protected CDOTransferElement[] doGetChildren() throws IOException
+ protected CDOTransferElement[] doGetChildren()
{
File[] children = file.listFiles();
CDOTransferElement[] result = new Element[children.length];
@@ -195,9 +217,16 @@ public class FileSystemTransferSystem extends CDOTransferSystem
}
@Override
- protected InputStream doOpenInputStream() throws IOException
+ protected InputStream doOpenInputStream()
{
- return new FileInputStream(file);
+ try
+ {
+ return new FileInputStream(file);
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
index 83f4fbb283..b876f40751 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
@@ -30,7 +30,6 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;
@@ -134,23 +133,23 @@ public class CDOTransfer implements INotifier
return result;
}
- public CDOTransferMapping map(IPath sourcePath) throws IOException
+ public CDOTransferMapping map(IPath sourcePath)
{
CDOTransferElement source = sourceSystem.getElement(sourcePath);
return map(source);
}
- public CDOTransferMapping map(String sourcePath) throws IOException
+ public CDOTransferMapping map(String sourcePath)
{
return map(new Path(sourcePath));
}
- public CDOTransferMapping map(CDOTransferElement source) throws IOException
+ public CDOTransferMapping map(CDOTransferElement source)
{
return map(source, rootMapping);
}
- protected CDOTransferMapping map(CDOTransferElement source, CDOTransferMapping parent) throws IOException
+ protected CDOTransferMapping map(CDOTransferElement source, CDOTransferMapping parent)
{
CDOTransferMapping mapping = mappings.get(source);
if (mapping == null)
@@ -175,7 +174,7 @@ public class CDOTransfer implements INotifier
mapping.getChildren();
}
- protected CDOTransferMapping createMapping(CDOTransferElement source, CDOTransferMapping parent) throws IOException
+ protected CDOTransferMapping createMapping(CDOTransferElement source, CDOTransferMapping parent)
{
return new CDOTransferMappingImpl(this, source, parent);
}
@@ -217,14 +216,14 @@ public class CDOTransfer implements INotifier
}
}
- public void perform() throws IOException
+ public void perform()
{
validate(rootMapping);
perform(rootMapping);
modelTransferContext.save();
}
- protected void perform(CDOTransferMapping mapping) throws IOException
+ protected void perform(CDOTransferMapping mapping)
{
CDOTransferType transferType = mapping.getTransferType();
if (transferType == CDOTransferType.FOLDER)
@@ -246,7 +245,7 @@ public class CDOTransfer implements INotifier
}
}
- protected void performFolder(CDOTransferMapping mapping) throws IOException
+ protected void performFolder(CDOTransferMapping mapping)
{
if (mapping.getStatus() == CDOTransferMapping.Status.NEW)
{
@@ -259,12 +258,12 @@ public class CDOTransfer implements INotifier
}
}
- protected void performModel(CDOTransferMapping mapping) throws IOException
+ protected void performModel(CDOTransferMapping mapping)
{
modelTransferContext.perform(mapping);
}
- protected void performBinary(CDOTransferMapping mapping) throws IOException
+ protected void performBinary(CDOTransferMapping mapping)
{
IPath path = mapping.getFullPath();
InputStream source = mapping.getSource().openInputStream();
@@ -279,7 +278,7 @@ public class CDOTransfer implements INotifier
}
}
- protected void performText(CDOTransferMapping mapping, String encoding) throws IOException
+ protected void performText(CDOTransferMapping mapping, String encoding)
{
IPath path = mapping.getFullPath();
InputStream source = mapping.getSource().openInputStream();
@@ -619,7 +618,7 @@ public class CDOTransfer implements INotifier
return sourceResourceSet.getResource(uri, true);
}
- protected Resource getTargetResource(CDOTransferMapping mapping) throws IOException
+ protected Resource getTargetResource(CDOTransferMapping mapping)
{
IPath path = mapping.getFullPath();
ResourceSet targetResourceSet = getTargetResourceSet();
@@ -659,7 +658,7 @@ public class CDOTransfer implements INotifier
return registry.getFactory(uri) != null;
}
- protected void perform(CDOTransferMapping mapping) throws IOException
+ protected void perform(CDOTransferMapping mapping)
{
Resource sourceResource = getSourceResource(mapping);
Resource targetResource = getTargetResource(mapping);
@@ -671,7 +670,7 @@ public class CDOTransfer implements INotifier
contents.addAll(targetContents);
}
- protected void save() throws IOException
+ protected void save()
{
for (Resource resource : elementResources.values())
{
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferElement.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferElement.java
index 477f4c81c0..1192904a9b 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferElement.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferElement.java
@@ -71,7 +71,7 @@ public abstract class CDOTransferElement
return system.getElement(path.removeLastSegments(1));
}
- public final CDOTransferElement[] getChildren() throws IOException
+ public final CDOTransferElement[] getChildren()
{
if (isDirectory())
{
@@ -81,18 +81,18 @@ public abstract class CDOTransferElement
return NO_CHILDREN;
}
- public final CDOTransferElement getChild(IPath path) throws IOException
+ public final CDOTransferElement getChild(IPath path)
{
IPath childPath = getPath().append(path.makeRelative());
return system.getElement(childPath);
}
- public final CDOTransferElement getChild(String path) throws IOException
+ public final CDOTransferElement getChild(String path)
{
return getChild(new Path(path));
}
- public final InputStream openInputStream() throws IOException
+ public final InputStream openInputStream()
{
checkNotDirectory();
return doOpenInputStream();
@@ -156,11 +156,11 @@ public abstract class CDOTransferElement
return getPath().toString();
}
- protected abstract CDOTransferElement[] doGetChildren() throws IOException;
+ protected abstract CDOTransferElement[] doGetChildren();
- protected abstract InputStream doOpenInputStream() throws IOException;
+ protected abstract InputStream doOpenInputStream();
- private void checkNotDirectory() throws IOException
+ private void checkNotDirectory()
{
if (isDirectory())
{
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
index 8c995778e2..336f169d94 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
@@ -15,7 +15,6 @@ import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -39,7 +38,6 @@ class CDOTransferMappingImpl implements CDOTransferMapping
private IPath relativePath;
public CDOTransferMappingImpl(CDOTransfer transfer, CDOTransferElement source, CDOTransferMapping parent)
- throws IOException
{
this.transfer = transfer;
this.source = source;
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferSystem.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferSystem.java
index b7aba10e8d..747b19f08a 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferSystem.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferSystem.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import java.io.IOException;
import java.io.InputStream;
/**
@@ -64,15 +63,17 @@ public abstract class CDOTransferSystem
public abstract CDOTransferElement getElement(IPath path);
- public abstract void createFolder(IPath path) throws IOException;
+ public abstract CDOTransferElement getElement(URI uri);
- public Resource createModel(ResourceSet resourceSet, IPath path) throws IOException
+ public abstract void createFolder(IPath path);
+
+ public Resource createModel(ResourceSet resourceSet, IPath path)
{
URI uri = getURI(path);
return resourceSet.createResource(uri);
}
- public abstract void createBinary(IPath path, InputStream source) throws IOException;
+ public abstract void createBinary(IPath path, InputStream source);
- public abstract void createText(IPath path, InputStream source, String encoding) throws IOException;
+ public abstract void createText(IPath path, InputStream source, String encoding);
}
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/TransferTest.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/TransferTest.java
index d3a41c90d5..e31b3a77e3 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/TransferTest.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/TransferTest.java
@@ -14,8 +14,6 @@ import org.eclipse.emf.cdo.spi.transfer.FileSystemTransferSystem;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
-import java.io.IOException;
-
/**
* @author Eike Stepper
* @since 4.2
@@ -24,7 +22,7 @@ public class TransferTest
{
public static final CDOTransferSystem FILE_SYSTEM = new FileSystemTransferSystem();
- public static void main(String[] args) throws IOException
+ public static void main(String[] args) throws Exception
{
CDOTransfer transfer = createTransfer();
dump(transfer.getRootMapping());
@@ -34,7 +32,7 @@ public class TransferTest
transfer.perform();
}
- public static CDOTransfer createTransfer() throws IOException
+ public static CDOTransfer createTransfer()
{
CDOTransfer transfer = new CDOTransfer(FILE_SYSTEM, FILE_SYSTEM);
transfer.getRootMapping().setRelativePath("C:/develop/transfer");

Back to the top