Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-14 15:00:41 +0000
committerEike Stepper2012-09-14 15:00:41 +0000
commit54118011462195cc6596be0f36393d7c70015b25 (patch)
treec78556b590f03248e863f0f6bf0daade83bd8181 /plugins
parent86b9f0f9b6f0ade19472328e86b899f58838fd0a (diff)
downloadcdo-54118011462195cc6596be0f36393d7c70015b25.tar.gz
cdo-54118011462195cc6596be0f36393d7c70015b25.tar.xz
cdo-54118011462195cc6596be0f36393d7c70015b25.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/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java32
1 files changed, 17 insertions, 15 deletions
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 3221e26956..c293ed7f14 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
@@ -16,6 +16,7 @@ import org.eclipse.net4j.util.event.Event;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.event.INotifier;
import org.eclipse.net4j.util.event.Notifier;
+import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.emf.common.notify.Notification;
@@ -32,6 +33,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
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;
@@ -224,7 +226,7 @@ public class CDOTransfer implements INotifier
{
validate(rootMapping);
perform(rootMapping);
- modelTransferContext.save();
+ modelTransferContext.performFinish();
}
protected void perform(CDOTransferMapping mapping)
@@ -710,30 +712,30 @@ public class CDOTransfer implements INotifier
protected void perform(CDOTransferMapping mapping)
{
Resource sourceResource = getSourceResource(mapping);
- Resource targetResource = getTargetResource(mapping);
+ Resource targetResource = getTargetResource(mapping); // Create target resource
EList<EObject> sourceContents = sourceResource.getContents();
- Collection<EObject> targetContents = EcoreUtil.copyAll(sourceContents); // copier.copyAll(sourceContents);
+ Collection<EObject> targetContents = copier.copyAll(sourceContents);
EList<EObject> contents = targetResource.getContents();
contents.addAll(targetContents);
}
- protected void save()
+ protected void performFinish()
{
copier.copyReferences();
- // try
- // {
- // for (Resource resource : elementResources.values())
- // {
- // resource.save(null);
- // }
- // }
- // catch (IOException ex)
- // {
- // throw new IORuntimeException(ex);
- // }
+ try
+ {
+ for (Resource resource : getTargetResourceSet().getResources())
+ {
+ resource.save(null);
+ }
+ }
+ catch (IOException ex)
+ {
+ throw new IORuntimeException(ex);
+ }
}
/**

Back to the top