Fix MANIFEST generation
[gpl/argeo-slc.git] / org.argeo.slc.repo / src / org / argeo / slc / repo / osgi / ImportBundlesZip.java
index fbc44b3e0e0fae545acf7449a43d69f5f2ab8d9b..626fa72e2d2b13feaeb3c9d38bdd86b9bb36879f 100644 (file)
@@ -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.osgi;
 
 import java.io.ByteArrayInputStream;
@@ -29,8 +14,7 @@ import javax.jcr.Repository;
 import javax.jcr.Session;
 
 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.jcr.JcrUtils;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.SlcException;
@@ -48,7 +32,7 @@ import org.eclipse.aether.artifact.DefaultArtifact;
  */
 @Deprecated
 public class ImportBundlesZip implements Runnable {
-       private final static Log log = LogFactory.getLog(ImportBundlesZip.class);
+       private final static CmsLog log = CmsLog.getLog(ImportBundlesZip.class);
        private Repository repository;
        private String workspace;
        private String groupId;
@@ -83,8 +67,7 @@ public class ImportBundlesZip implements Runnable {
                        ZipEntry zipEntry = null;
                        entries: while ((zipEntry = zipIn.getNextEntry()) != null) {
                                String entryName = zipEntry.getName();
-                               if (!entryName.endsWith(".jar")
-                                               || entryName.contains("feature"))
+                               if (!entryName.endsWith(".jar") || entryName.contains("feature"))
                                        continue entries;// skip
                                byte[] jarBytes = IOUtils.toByteArray(zipIn);
                                zipIn.closeEntry();
@@ -103,8 +86,7 @@ public class ImportBundlesZip implements Runnable {
                                        continue entries;
                                }
 
-                               String bundleName = RepoUtils
-                                               .extractBundleNameFromSourceName(nv.getName());
+                               String bundleName = RepoUtils.extractBundleNameFromSourceName(nv.getName());
                                // skip excluded bundles and their sources
                                if (excludedBundles.contains(bundleName))
                                        continue entries;
@@ -113,10 +95,9 @@ public class ImportBundlesZip implements Runnable {
                                // continue entries;
                                // }
 
-                               Artifact artifact = new DefaultArtifact(groupId, nv.getName(),
-                                               "jar", nv.getVersion());
-                               Node artifactNode = RepoUtils.copyBytesAsArtifact(
-                                               session.getNode(artifactBasePath), artifact, jarBytes);
+                               Artifact artifact = new DefaultArtifact(groupId, nv.getName(), "jar", nv.getVersion());
+                               Node artifactNode = RepoUtils.copyBytesAsArtifact(session.getNode(artifactBasePath), artifact,
+                                               jarBytes);
                                jarBytes = null;// superstition, in order to free memory
 
                                // indexes
@@ -127,8 +108,7 @@ public class ImportBundlesZip implements Runnable {
                                        log.debug("Imported " + entryName + " to " + artifactNode);
                        }
                } catch (Exception e) {
-                       throw new SlcException("Cannot import zip " + zipFile + " to "
-                                       + workspace, e);
+                       throw new SlcException("Cannot import zip " + zipFile + " to " + workspace, e);
                } finally {
                        IOUtils.closeQuietly(zipIn);
                        IOUtils.closeQuietly(jarIn);