incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r922186 - in /sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal: ClassPathEntry.java net/FileParts.java net/JCRJarURLConnection.java net/JCRJarURLHandler.java net/URLFactory.java
Date Fri, 12 Mar 2010 09:06:51 GMT
Author: cziegeler
Date: Fri Mar 12 09:06:51 2010
New Revision: 922186

URL: http://svn.apache.org/viewvc?rev=922186&view=rev
Log:
Remove unused code from jcr classloader

Removed:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/JCRJarURLConnection.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/JCRJarURLHandler.java
Modified:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassPathEntry.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/FileParts.java
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/URLFactory.java

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassPathEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassPathEntry.java?rev=922186&r1=922185&r2=922186&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassPathEntry.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/ClassPathEntry.java
Fri Mar 12 09:06:51 2010
@@ -42,8 +42,7 @@ import org.slf4j.LoggerFactory;
 public final class ClassPathEntry {
 
     /** default logging */
-    private static final Logger log =
-        LoggerFactory.getLogger(ClassPathEntry.class);
+    private static final Logger log = LoggerFactory.getLogger(ClassPathEntry.class);
 
     /** The session assigned to this class path entry */
     protected final Session session;

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/FileParts.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/FileParts.java?rev=922186&r1=922185&r2=922186&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/FileParts.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/FileParts.java
Fri Mar 12 09:06:51 2010
@@ -132,7 +132,7 @@ class FileParts {
         this.workspace = decode(file.substring(slash0, slash1));
 
         String fullPath = file.substring(slash1);
-        int bangSlash = JCRJarURLHandler.indexOfBangSlash(fullPath);
+        int bangSlash = indexOfBangSlash(fullPath);
         if (bangSlash < 0) {
             this.path = fullPath;
             this.entryPath = null;
@@ -143,6 +143,20 @@ class FileParts {
     }
 
     /**
+     * Finds the position of the bang slash (!/) in the file part of the URL.
+     */
+    static int indexOfBangSlash(String file) {
+
+        for (int i = file.length(); (i = file.lastIndexOf('!', i)) != -1; i--) {
+            if (i != file.length() - 1 && file.charAt(i + 1) == '/') {
+                return i + 1;
+            }
+        }
+
+        return -1;
+    }
+
+    /**
      * Returns the plain name of the repository.
      */
     String getRepository() {

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/URLFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/URLFactory.java?rev=922186&r1=922185&r2=922186&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/URLFactory.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/net/URLFactory.java
Fri Mar 12 09:06:51 2010
@@ -65,35 +65,4 @@ public final class URLFactory {
             new FileParts(session, path, null).toString(),
             new JCRURLHandler(session));
     }
-
-    /**
-     * Creates a new JCRJar URL for the given session, archive and entry.
-     *
-     * @param session The repository session providing access to the archive.
-     * @param path The absolute path to the archive. This must either be the
-     *      property containing the archive or an item which resolves to such
-     *      a property through its primary item chain. This must be an absolute
-     *      path with a leading slash character. If this is <code>null</code>
-     *      the root node path - <code>/</code> - is assumed.
-     * @param entry The entry within the archive. If <code>null</code>, the URL
-     *      provides access to the archive itself.
-     *
-     * @return The JCRJar URL
-     *
-     * @throws MalformedURLException If an error occurrs creating the
-     *      <code>URL</code> instance.
-     */
-    public static URL createJarURL(Session session, String path, String entry)
-        throws MalformedURLException {
-
-        JCRJarURLHandler handler = new JCRJarURLHandler(session);
-        String file = createURL(session, path).toExternalForm();
-
-        // append entry spec if not null
-        if (entry != null) {
-            file += "!/" + entry;
-        }
-
-        return new URL(REPOSITORY_JAR_SCHEME, "", -1, file, handler);
-    }
 }



Mime
View raw message