geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1089935 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java
Date Thu, 07 Apr 2011 16:26:00 GMT
Author: dblevins
Date: Thu Apr  7 16:26:00 2011
New Revision: 1089935

URL: http://svn.apache.org/viewvc?rev=1089935&view=rev
Log:
include/exclude methods that take just plain url

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java?rev=1089935&r1=1089934&r2=1089935&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java (original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/UrlSet.java Thu
Apr  7 16:26:00 2011
@@ -17,8 +17,6 @@
 package org.apache.xbean.finder;
 
 import org.apache.xbean.finder.filter.Filter;
-import org.apache.xbean.finder.filter.Filters;
-import org.apache.xbean.finder.filter.RegexFilter;
 
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -85,6 +83,13 @@ public class UrlSet {
         return new UrlSet(urls);
     }
 
+
+    public UrlSet include(URL url){
+        Map<String, URL> urls = new HashMap<String, URL>(this.urls);
+        urls.put(url.toExternalForm(), url);
+        return new UrlSet(urls);
+    }
+
     public UrlSet exclude(UrlSet urlSet) {
         Map<String, URL> urls = new HashMap<String, URL>(this.urls);
         Map<String, URL> parentUrls = urlSet.urls;
@@ -94,6 +99,12 @@ public class UrlSet {
         return new UrlSet(urls);
     }
 
+    public UrlSet exclude(URL url) {
+        Map<String, URL> urls = new HashMap<String, URL>(this.urls);
+        urls.remove(url.toExternalForm());
+        return new UrlSet(urls);
+    }
+
     public UrlSet exclude(ClassLoader parent) throws IOException {
         return exclude(new UrlSet(parent));
     }



Mime
View raw message