[jboss-osgi-commits] JBoss-OSGI SVN: r102130 - projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs.

jboss-osgi-commits at lists.jboss.org jboss-osgi-commits at lists.jboss.org
Tue Mar 9 09:56:03 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-03-09 09:56:02 -0500 (Tue, 09 Mar 2010)
New Revision: 102130

Removed:
   projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/ManifestBuilder.java
   projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFileAssembly.java
Modified:
   projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/AbstractVFS.java
   projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSAdaptor.java
   projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
Log:
Remove VirtualFileAssembly

Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/AbstractVFS.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/AbstractVFS.java	2010-03-09 14:54:52 UTC (rev 102129)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/AbstractVFS.java	2010-03-09 14:56:02 UTC (rev 102130)
@@ -22,7 +22,6 @@
 package org.jboss.osgi.vfs;
 
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.net.URL;
 
 /**
@@ -42,11 +41,6 @@
       return getVFSAdaptor().getChild(url);
    }
 
-   public static VirtualFileAssembly createVirtualFileAssembly(String name) throws IOException, URISyntaxException
-   {
-      return getVFSAdaptor().createVirtualFileAssembly(name);
-   }
-
    public static VirtualFile adapt(Object virtualFile)
    {
       return getVFSAdaptor().adapt(virtualFile);

Deleted: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/ManifestBuilder.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/ManifestBuilder.java	2010-03-09 14:54:52 UTC (rev 102129)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/ManifestBuilder.java	2010-03-09 14:56:02 UTC (rev 102130)
@@ -1,138 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.vfs;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import org.osgi.framework.Constants;
-
-/**
- * A simple OSGi manifest builder.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Mar-2010
- */
-public final class ManifestBuilder
-{
-   private StringWriter sw;
-   private PrintWriter pw;
-   private List<String> importPackages = new ArrayList<String>();
-   private List<String> exportPackages = new ArrayList<String>();
-
-   public static ManifestBuilder newInstance()
-   {
-      return new ManifestBuilder();
-   }
-
-   private ManifestBuilder()
-   {
-      sw = new StringWriter();
-      pw = new PrintWriter(sw);
-      pw.println(Attributes.Name.MANIFEST_VERSION + ": 1.0");
-   }
-
-   public ManifestBuilder addBundleManifestVersion(int version)
-   {
-      pw.println(Constants.BUNDLE_MANIFESTVERSION + ": " + version);
-      return this;
-   }
-
-   public ManifestBuilder addBundleSymbolicName(String symbolicName)
-   {
-      pw.println(Constants.BUNDLE_SYMBOLICNAME + ": " + symbolicName);
-      return this;
-   }
-
-   public ManifestBuilder addBundleActivator(String bundleActivator)
-   {
-      pw.println(Constants.BUNDLE_ACTIVATOR + ": " + bundleActivator);
-      return this;
-   }
-
-   public ManifestBuilder addImportPackages(String... packages)
-   {
-      for (String aux : packages)
-         importPackages.add(aux);
-
-      return this;
-   }
-
-   public ManifestBuilder addExportPackages(String... packages)
-   {
-      for (String aux : packages)
-         exportPackages.add(aux);
-
-      return this;
-   }
-
-   public ManifestBuilder addManifestHeader(String key, String value)
-   {
-      pw.println(key + ": " + value);
-      return this;
-   }
-
-   public Manifest getManifest()
-   {
-      if (exportPackages.size() > 0)
-      {
-         pw.print(Constants.EXPORT_PACKAGE + ": ");
-         for (int i = 0; i < exportPackages.size(); i++)
-         {
-            if (i > 0)
-               pw.print(",");
-            
-            pw.print(exportPackages.get(i));
-         }
-         pw.println();
-      }
-      
-      if (importPackages.size() > 0)
-      {
-         pw.print(Constants.IMPORT_PACKAGE + ": ");
-         for (int i = 0; i < importPackages.size(); i++)
-         {
-            if (i > 0)
-               pw.print(",");
-            
-            pw.print(importPackages.get(i));
-         }
-         pw.println();
-      }
-      
-      try
-      {
-         Manifest manifest = new Manifest(new ByteArrayInputStream(sw.toString().getBytes()));
-         return manifest;
-      }
-      catch (IOException ex)
-      {
-         throw new IllegalStateException("Cannot create manifest", ex);
-      }
-   }
-}

Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSAdaptor.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSAdaptor.java	2010-03-09 14:54:52 UTC (rev 102129)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VFSAdaptor.java	2010-03-09 14:56:02 UTC (rev 102130)
@@ -22,7 +22,6 @@
 package org.jboss.osgi.vfs;
 
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.net.URL;
 
 /**
@@ -45,8 +44,6 @@
     */
    VirtualFile getChild(URL url) throws IOException;
 
-   VirtualFileAssembly createVirtualFileAssembly(String name) throws IOException, URISyntaxException;
-   
    /**
     * Adapt a concrete instance of a jboss-vfs VirtualFile.
     * @param virtualFile The VirtualFile instance

Modified: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java	2010-03-09 14:54:52 UTC (rev 102129)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFile.java	2010-03-09 14:56:02 UTC (rev 102130)
@@ -56,8 +56,7 @@
    String getPathName();
    
    /**
-    * Whether it is a simple leaf of the VFS,
-    * i.e. whether it can contain other files
+    * Whether it is a file in the VFS.
     *
     * @return true if a simple file.
     * @throws IOException for any problem accessing the virtual file system
@@ -66,6 +65,15 @@
    boolean isFile() throws IOException;
    
    /**
+    * Whether it is a directory in the VFS.
+    *
+    * @return true if a directory.
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   boolean isDirectory() throws IOException;
+   
+   /**
     * Get the VF URL (file://root/org/jboss/X.java)
     *
     * @return the full URL to the VF in the VFS.
@@ -76,6 +84,15 @@
    URL toURL() throws MalformedURLException, URISyntaxException;
 
    /**
+    * Get the parent
+    *
+    * @return the parent or null if there is no parent
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   VirtualFile getParent() throws IOException;
+   
+   /**
     * Get a child
     *
     * @param path the path

Deleted: projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFileAssembly.java
===================================================================
--- projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFileAssembly.java	2010-03-09 14:54:52 UTC (rev 102129)
+++ projects/jboss-osgi/projects/vfs/trunk/api/src/main/java/org/jboss/osgi/vfs/VirtualFileAssembly.java	2010-03-09 14:56:02 UTC (rev 102130)
@@ -1,93 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.osgi.vfs;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.jar.Manifest;
-
-
-/**
- * A basic abstraction of a VirtualFileAssembly used by the OSGi layer. 
- * 
- * This abstraction should be removed once we settle on a single jboss-vfs version.
- * 
- * @author thomas.diesler at jboss.com
- * @since 02-Mar-2010
- */
-public interface VirtualFileAssembly extends VirtualFile
-{
-   /**
-    * Add the given class to the assembly.
-    *  
-    * @param clazz The class to add
-    * @throws IOException for any error
-    */
-   void addClass(Class<?> clazz) throws IOException;
-   
-   /**
-    * Add the given package to the assembly.
-    *  
-    * @param clazz The package to add
-    * @throws IOException for any error
-    */
-   void addPackage(Class<?> clazz) throws IOException;
-   
-   /**
-    * Pack this assembly into a jar file. 
-    * @throws IOException for any error
-    */
-   File pack() throws IOException;
-   
-   /**
-    * Add the given manifest to the assembly
-    * @param manifest The manifest to add 
-    * @throws IOException for any error
-    */
-   void addManifest(Manifest manifest) throws IOException;
-   
-   /**
-    * Add files recursively from root, using the no jars filter.
-    *
-    * @param root the root
-    * @throws IOException for any error
-    */
-   @Deprecated
-   void addPath(VirtualFile file) throws IOException;
-
-   /**
-    * Locate the .class resource of baseResource.  From this resource, determine the base of the resource
-    * i.e. what jar or classpath directory it lives in.
-    *
-    * Once the base of the resource is found, scan all files recursively within the base using the include and exclude
-    * patterns.  A mirror file structure will be created within this AssembledDirectory. Ths is very useful when you
-    * want to create a virtual jar that contains a subset of .class files in your classpath.
-    *
-    * The include/exclude patterns follow the Ant file pattern matching syntax.  See ant.apache.org for more details.
-    *
-    * @param baseResource the base resource
-    * @param includes the includes
-    * @param excludes the excludes
-    */
-   @Deprecated
-   void addResources(Class<?> reference, String[] includes, String[] excludes);
-}



More information about the jboss-osgi-commits mailing list