-/*
- * 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;
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
private String dataModelNodePath;
private String targetVersion;
- private Resource migrationCnd;
+ private URL migrationCnd;
private JcrCallback dataModification;
/**
+ " 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();
// 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);
this.targetVersion = targetVersion;
}
- public void setMigrationCnd(Resource migrationCnd) {
+ public void setMigrationCnd(URL migrationCnd) {
this.migrationCnd = migrationCnd;
}