X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.repo%2Fsrc%2Forg%2Fargeo%2Fslc%2Frepo%2FRepoUtils.java;h=3daa8079b5926141182423a382608889e0c68e61;hb=d64292c93f4a3532576e98f651344d89e883e2aa;hp=e09f80cbaa53bee27bddb47a40e6359e1d642ce4;hpb=8a01e42cd1a963be1f37d444f15e09512dc7d07f;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.repo/src/org/argeo/slc/repo/RepoUtils.java b/org.argeo.slc.repo/src/org/argeo/slc/repo/RepoUtils.java index e09f80cba..3daa8079b 100644 --- a/org.argeo.slc.repo/src/org/argeo/slc/repo/RepoUtils.java +++ b/org.argeo.slc.repo/src/org/argeo/slc/repo/RepoUtils.java @@ -1,18 +1,3 @@ -/* - * 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.slc.repo; import java.io.ByteArrayOutputStream; @@ -49,20 +34,19 @@ import javax.jcr.nodetype.NodeType; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.argeo.api.cms.CmsLog; +import org.argeo.cms.ArgeoNames; +import org.argeo.cms.ArgeoTypes; +import org.argeo.cms.jcr.CmsJcrUtils; +import org.argeo.cms.security.Keyring; import org.argeo.jcr.JcrMonitor; import org.argeo.jcr.JcrUtils; -import org.argeo.node.ArgeoNames; -import org.argeo.node.ArgeoTypes; -import org.argeo.node.NodeUtils; -import org.argeo.node.security.Keyring; import org.argeo.slc.DefaultNameVersion; import org.argeo.slc.NameVersion; import org.argeo.slc.SlcException; -import org.argeo.slc.aether.ArtifactIdComparator; -import org.argeo.slc.jcr.SlcNames; -import org.argeo.slc.jcr.SlcTypes; +import org.argeo.slc.SlcNames; +import org.argeo.slc.SlcTypes; +import org.argeo.slc.repo.maven.ArtifactIdComparator; import org.argeo.slc.repo.maven.MavenConventionsUtils; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; @@ -70,7 +54,7 @@ import org.osgi.framework.Constants; /** Utilities around repo */ public class RepoUtils implements ArgeoNames, SlcNames { - private final static Log log = LogFactory.getLog(RepoUtils.class); + private final static CmsLog log = CmsLog.getLog(RepoUtils.class); /** Packages a regular sources jar as PDE source. */ public static void packagesAsPdeSource(File sourceFile, @@ -269,7 +253,6 @@ public class RepoUtils implements ArgeoNames, SlcNames { // probably not a jar, skipping if (log.isDebugEnabled()) { log.debug("Skipping because of " + e); - e.printStackTrace(); } } finally { IOUtils.closeQuietly(jarInputStream); @@ -379,10 +362,10 @@ public class RepoUtils implements ArgeoNames, SlcNames { if (repoNode.isNodeType(ArgeoTypes.ARGEO_REMOTE_REPOSITORY)) { String uri = repoNode.getProperty(ARGEO_URI).getString(); if (uri.startsWith("http")) {// http, https - repository = NodeUtils.getRepositoryByUri( + repository = CmsJcrUtils.getRepositoryByUri( repositoryFactory, uri); } else if (uri.startsWith("vm:")) {// alias - repository = NodeUtils.getRepositoryByUri( + repository = CmsJcrUtils.getRepositoryByUri( repositoryFactory, uri); } else { throw new SlcException("Unsupported repository uri " + uri); @@ -445,7 +428,7 @@ public class RepoUtils implements ArgeoNames, SlcNames { // Anonymous URI only workspace if (repoNode == null) // Anonymous - currRepo = NodeUtils.getRepositoryByUri(repositoryFactory, uri); + currRepo = CmsJcrUtils.getRepositoryByUri(repositoryFactory, uri); else { currRepo = RepoUtils.getRepository(repositoryFactory, keyring, repoNode); @@ -643,8 +626,7 @@ public class RepoUtils implements ArgeoNames, SlcNames { monitor.worked(1); } catch (RepositoryException e) { - throw new SlcException("Cannot copy " + fromNode + " to " + toNode, - e); + throw new SlcException("Cannot copy " + fromNode + " to " + toNode, e); } }