X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjackrabbit%2FJackrabbitDataModelMigration.java;h=2e87b347d77a3c915c41f035816505bc61c3c6c1;hb=110c8771cda70be5bb6458281d025dc3d9d3919e;hp=e53ed557774bfeae9e70b06c546caa3eb1c3040e;hpb=61780b581925666edd4bd7743a00dca7170f1d35;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.jcr/src/org/argeo/jackrabbit/JackrabbitDataModelMigration.java b/org.argeo.jcr/src/org/argeo/jackrabbit/JackrabbitDataModelMigration.java index e53ed5577..2e87b347d 100644 --- a/org.argeo.jcr/src/org/argeo/jackrabbit/JackrabbitDataModelMigration.java +++ b/org.argeo.jcr/src/org/argeo/jackrabbit/JackrabbitDataModelMigration.java @@ -1,24 +1,9 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package org.argeo.jackrabbit; import java.io.InputStreamReader; import java.io.Reader; +import java.net.URL; -import javax.jcr.Node; import javax.jcr.Session; import org.apache.commons.io.IOUtils; @@ -29,7 +14,6 @@ import org.apache.jackrabbit.core.config.RepositoryConfig; import org.argeo.jcr.ArgeoJcrException; import org.argeo.jcr.JcrCallback; import org.argeo.jcr.JcrUtils; -import org.springframework.core.io.Resource; /** Migrate the data in a Jackrabbit repository. */ @Deprecated @@ -40,7 +24,7 @@ public class JackrabbitDataModelMigration implements private String dataModelNodePath; private String targetVersion; - private Resource migrationCnd; + private URL migrationCnd; private JcrCallback dataModification; /** @@ -60,7 +44,7 @@ public class JackrabbitDataModelMigration implements + " does not exist: nothing to migrate."); return false; } - Node dataModelNode = session.getNode(dataModelNodePath); +// Node dataModelNode = session.getNode(dataModelNodePath); // if (dataModelNode.hasProperty(ArgeoNames.ARGEO_DATA_MODEL_VERSION)) { // String currentVersion = dataModelNode.getProperty( // ArgeoNames.ARGEO_DATA_MODEL_VERSION).getString(); @@ -73,7 +57,7 @@ public class JackrabbitDataModelMigration implements // apply transitional CND if (migrationCnd != null) { - reader = new InputStreamReader(migrationCnd.getInputStream()); + reader = new InputStreamReader(migrationCnd.openStream()); CndImporter.registerNodeTypes(reader, session, true); session.save(); log.info("Registered migration node types from " + migrationCnd); @@ -164,7 +148,7 @@ public class JackrabbitDataModelMigration implements this.targetVersion = targetVersion; } - public void setMigrationCnd(Resource migrationCnd) { + public void setMigrationCnd(URL migrationCnd) { this.migrationCnd = migrationCnd; }