felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r825120 - in /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall: ./ internal/
Date Wed, 14 Oct 2009 13:00:05 GMT
Author: gnodet
Date: Wed Oct 14 13:00:05 2009
New Revision: 825120

URL: http://svn.apache.org/viewvc?rev=825120&view=rev
Log:
[fileinstall] fix code format

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactInstaller.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactListener.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactTransformer.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactUrlTransformer.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Artifact.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/BundleTransformer.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/JarDirUrlHandler.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactInstaller.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactInstaller.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactInstaller.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactInstaller.java
Wed Oct 14 13:00:05 2009
@@ -30,7 +30,8 @@
  * artifacts will be reported as new, while any deleted artifact
  * won't be reported as deleted.
  */
-public interface ArtifactInstaller extends ArtifactListener {
+public interface ArtifactInstaller extends ArtifactListener
+{
 
     /**
      * Install the artifact

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactListener.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactListener.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactListener.java
Wed Oct 14 13:00:05 2009
@@ -27,7 +27,8 @@
  * {@link ArtifactInstaller}.
  *
  */
-public interface ArtifactListener {
+public interface ArtifactListener
+{
 	
 	/**
      * Returns true if the listener can process the given artifact.

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactTransformer.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactTransformer.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactTransformer.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactTransformer.java
Wed Oct 14 13:00:05 2009
@@ -24,7 +24,8 @@
  * kind of artifacts to OSGi bundles.
  *
  */
-public interface ArtifactTransformer extends ArtifactListener {
+public interface ArtifactTransformer extends ArtifactListener
+{
 
     /**
      * Process the given file (canHandle returned true previously)

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactUrlTransformer.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactUrlTransformer.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactUrlTransformer.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/ArtifactUrlTransformer.java
Wed Oct 14 13:00:05 2009
@@ -26,7 +26,8 @@
  * This kind of artifact listener should be favored over the {@link ArtifactTransformer}
  * because it allows the use of the OSGi update feature on bundles.
  */
-public interface ArtifactUrlTransformer extends ArtifactListener {
+public interface ArtifactUrlTransformer extends ArtifactListener
+{
 
     /**
      * Process the given file (canHandle returned true previously)

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Artifact.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Artifact.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Artifact.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Artifact.java
Wed Oct 14 13:00:05 2009
@@ -26,7 +26,8 @@
 /**
  * An artifact that has been dropped into one watched directory.
  */
-public class Artifact {
+public class Artifact
+{
 
     private File path;
     private File jaredDirectory;
@@ -37,67 +38,83 @@
     private long bundleId = -1;
     private long checksum;
 
-    public File getPath() {
+    public File getPath()
+    {
         return path;
     }
 
-    public void setPath(File path) {
+    public void setPath(File path)
+    {
         this.path = path;
     }
 
-    public File getJaredDirectory() {
+    public File getJaredDirectory()
+    {
         return jaredDirectory;
     }
 
-    public void setJaredDirectory(File jaredDirectory) {
+    public void setJaredDirectory(File jaredDirectory)
+    {
         this.jaredDirectory = jaredDirectory;
     }
 
-    public URL getJaredUrl() {
+    public URL getJaredUrl()
+    {
         return jaredUrl;
     }
 
-    public void setJaredUrl(URL jaredUrl) {
+    public void setJaredUrl(URL jaredUrl)
+    {
         this.jaredUrl = jaredUrl;
     }
 
-    public ArtifactListener getListener() {
+    public ArtifactListener getListener()
+    {
         return listener;
     }
 
-    public void setListener(ArtifactListener listener) {
+    public void setListener(ArtifactListener listener)
+    {
         this.listener = listener;
     }
 
-    public File getTransformed() {
+    public File getTransformed()
+    {
         return transformed;
     }
 
-    public void setTransformed(File transformed) {
+    public void setTransformed(File transformed)
+    {
         this.transformed = transformed;
     }
 
-    public URL getTransformedUrl() {
+    public URL getTransformedUrl()
+    {
         return transformedUrl;
     }
 
-    public void setTransformedUrl(URL transformedUrl) {
+    public void setTransformedUrl(URL transformedUrl)
+    {
         this.transformedUrl = transformedUrl;
     }
 
-    public long getBundleId() {
+    public long getBundleId()
+    {
         return bundleId;
     }
 
-    public void setBundleId(long bundleId) {
+    public void setBundleId(long bundleId)
+    {
         this.bundleId = bundleId;
     }
 
-    public long getChecksum() {
+    public long getChecksum()
+    {
         return checksum;
     }
 
-    public void setChecksum(long checksum) {
+    public void setChecksum(long checksum)
+    {
         this.checksum = checksum;
     }
 }

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/BundleTransformer.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/BundleTransformer.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/BundleTransformer.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/BundleTransformer.java
Wed Oct 14 13:00:05 2009
@@ -21,11 +21,10 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
-import java.util.jar.Attributes;
 
-import org.apache.felix.fileinstall.ArtifactTransformer;
 import org.apache.felix.fileinstall.ArtifactUrlTransformer;
 
 /**
@@ -77,7 +76,8 @@
         return false;
     }
 
-    public URL transform(URL artifact) {
+    public URL transform(URL artifact)
+    {
         return artifact;
     }
 

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
Wed Oct 14 13:00:05 2009
@@ -26,7 +26,6 @@
 import java.util.Properties;
 
 import org.apache.felix.fileinstall.ArtifactInstaller;
-import org.apache.felix.fileinstall.internal.Util;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.Configuration;
 
@@ -38,23 +37,28 @@
 {
     BundleContext context;
 
-    ConfigInstaller(BundleContext context) {
+    ConfigInstaller(BundleContext context)
+    {
         this.context = context;
     }
 
-    public boolean canHandle(File artifact) {
+    public boolean canHandle(File artifact)
+    {
         return artifact.getName().endsWith(".cfg");
     }
 
-    public void install(File artifact) throws Exception {
+    public void install(File artifact) throws Exception
+    {
         setConfig(artifact);
     }
 
-    public void update(File artifact) throws Exception {
+    public void update(File artifact) throws Exception
+    {
         setConfig(artifact);
     }
 
-    public void uninstall(File artifact) throws Exception {
+    public void uninstall(File artifact) throws Exception
+    {
         deleteConfig(artifact);
     }
 

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Wed Oct 14 13:00:05 2009
@@ -41,7 +41,6 @@
 import org.apache.felix.fileinstall.ArtifactListener;
 import org.apache.felix.fileinstall.ArtifactTransformer;
 import org.apache.felix.fileinstall.ArtifactUrlTransformer;
-import org.apache.felix.fileinstall.internal.Util;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
@@ -200,7 +199,8 @@
         }
     }
 
-    private void process(Set files) {
+    private void process(Set files)
+    {
         List/*<ArtifactListener>*/ listeners = FileInstall.getListeners();
         List/*<Artifact>*/ deleted = new ArrayList/*<Artifact>*/();
         List/*<Artifact>*/ modified = new ArrayList/*<Artifact>*/();
@@ -411,7 +411,8 @@
         }
     }
 
-    private void deleteJaredDirectory(Artifact artifact) {
+    private void deleteJaredDirectory(Artifact artifact)
+    {
         if (artifact.getJaredDirectory() != null
                 && !artifact.getJaredDirectory().equals(artifact.getPath())
                 && !artifact.getJaredDirectory().delete())

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
Wed Oct 14 13:00:05 2009
@@ -26,19 +26,15 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.imageio.spi.ServiceRegistry;
-
 import org.apache.felix.fileinstall.ArtifactInstaller;
 import org.apache.felix.fileinstall.ArtifactListener;
 import org.apache.felix.fileinstall.ArtifactTransformer;
 import org.apache.felix.fileinstall.ArtifactUrlTransformer;
-import org.apache.felix.fileinstall.internal.Util;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.cm.ConfigurationException;
 import org.osgi.service.cm.ManagedServiceFactory;

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/JarDirUrlHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/JarDirUrlHandler.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/JarDirUrlHandler.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/JarDirUrlHandler.java
Wed Oct 14 13:00:05 2009
@@ -17,8 +17,6 @@
  */
 package org.apache.felix.fileinstall.internal;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
Wed Oct 14 13:00:05 2009
@@ -18,15 +18,14 @@
  */
 package org.apache.felix.fileinstall.internal;
 
-import java.util.Map;
+import java.io.File;
+import java.io.FilenameFilter;
 import java.util.HashMap;
-import java.util.Set;
-import java.util.Collection;
-import java.util.Iterator;
 import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
 import java.util.zip.CRC32;
-import java.io.File;
-import java.io.FilenameFilter;
 
 /**
  * A Scanner object is able to detect and report new, modified

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java?rev=825120&r1=825119&r2=825120&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
Wed Oct 14 13:00:05 2009
@@ -18,29 +18,29 @@
  */
 package org.apache.felix.fileinstall.internal;
 
+import java.io.BufferedOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.FileInputStream;
 import java.io.File;
-import java.io.BufferedOutputStream;
+import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.OutputStream;
+import java.util.Collections;
 import java.util.Dictionary;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Enumeration;
 import java.util.Set;
-import java.util.Collections;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
 import java.util.jar.JarFile;
 import java.util.jar.JarOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogService;
-import org.osgi.framework.ServiceReference;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
 
 public class Util
 {
@@ -281,27 +281,34 @@
      * @param zipName
      * @throws IOException
      */
-    public static void jarDir(File directory, File zipName) throws IOException {
+    public static void jarDir(File directory, File zipName) throws IOException
+    {
         jarDir(directory, new BufferedOutputStream(new FileOutputStream(zipName)));
     }
 
-    public static void jarDir(File directory, OutputStream os) throws IOException {
+    public static void jarDir(File directory, OutputStream os) throws IOException
+    {
         // create a ZipOutputStream to zip the data to
         JarOutputStream zos = new JarOutputStream(os);
         String path = "";
         File manFile = new File(directory, JarFile.MANIFEST_NAME);
-        if (manFile.exists()) {
+        if (manFile.exists())
+        {
             byte[] readBuffer = new byte[8192];
             FileInputStream fis = new FileInputStream(manFile);
-            try {
+            try
+            {
                 ZipEntry anEntry = new ZipEntry(JarFile.MANIFEST_NAME);
                 zos.putNextEntry(anEntry);
                 int bytesIn = fis.read(readBuffer);
-                while (bytesIn != -1) {
+                while (bytesIn != -1)
+                {
                     zos.write(readBuffer, 0, bytesIn);
                     bytesIn = fis.read(readBuffer);
                 }
-            } finally {
+            }
+            finally
+            {
                 fis.close();
             }
             zos.closeEntry();
@@ -319,30 +326,38 @@
      * @param exclusions
      * @throws IOException
      */
-    public static void zipDir(File directory, ZipOutputStream zos, String path, Set/* <String>
*/ exclusions) throws IOException {
+    public static void zipDir(File directory, ZipOutputStream zos, String path, Set/* <String>
*/ exclusions) throws IOException
+    {
         // get a listing of the directory content
         File[] dirList = directory.listFiles();
         byte[] readBuffer = new byte[8192];
         int bytesIn = 0;
         // loop through dirList, and zip the files
-        for (int i = 0; i < dirList.length; i++) {
+        for (int i = 0; i < dirList.length; i++)
+        {
             File f = dirList[i];
-            if (f.isDirectory()) {
+            if (f.isDirectory())
+            {
                 zipDir(f, zos, path + f.getName() + "/", exclusions);
                 continue;
             }
             String entry = path + f.getName();
-            if (!exclusions.contains(entry)) {
+            if (!exclusions.contains(entry))
+            {
                 FileInputStream fis = new FileInputStream(f);
-                try {
+                try
+                {
                     ZipEntry anEntry = new ZipEntry(entry);
                     zos.putNextEntry(anEntry);
                     bytesIn = fis.read(readBuffer);
-                    while (bytesIn != -1) {
+                    while (bytesIn != -1)
+                    {
                         zos.write(readBuffer, 0, bytesIn);
                         bytesIn = fis.read(readBuffer);
                     }
-                } finally {
+                }
+                finally
+                {
                     fis.close();
                 }
             }
@@ -419,7 +434,8 @@
         }
     }
 
-    private static String getBundleKey(Bundle b) {
+    private static String getBundleKey(Bundle b)
+    {
         StringBuffer sb = new StringBuffer();
         sb.append(b.getSymbolicName()).append("_");
         String version = (String) b.getHeaders().get( "Bundle-Version" );



Mime
View raw message