[jboss-cvs] JBossAS SVN: r80017 - in projects/jboss-seam-int/trunk: jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 24 03:49:22 EDT 2008
Author: alesj
Date: 2008-10-24 03:49:21 -0400 (Fri, 24 Oct 2008)
New Revision: 80017
Added:
projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java
Modified:
projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java
projects/jboss-seam-int/trunk/pom.xml
Log:
Update external libs.
Suppress any item handling error.
Added: projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java
===================================================================
--- projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java (rev 0)
+++ projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/LeafVirtualFileFilter.java 2008-10-24 07:49:21 UTC (rev 80017)
@@ -0,0 +1,53 @@
+/*
+* 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.seam.integration.jbossas.vfs;
+
+import java.io.IOException;
+
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Only accept leaves.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class LeafVirtualFileFilter implements VirtualFileFilter
+{
+ public static final VirtualFileFilter INSTANCE = new LeafVirtualFileFilter();
+
+ private LeafVirtualFileFilter()
+ {
+ }
+
+ public boolean accepts(VirtualFile file)
+ {
+ try
+ {
+ return file.isLeaf();
+ }
+ catch (IOException e)
+ {
+ return false;
+ }
+ }
+}
Modified: projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java
===================================================================
--- projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java 2008-10-24 07:07:49 UTC (rev 80016)
+++ projects/jboss-seam-int/trunk/jbossas/src/main/java/org/jboss/seam/integration/jbossas/vfs/VFSScanner.java 2008-10-24 07:49:21 UTC (rev 80017)
@@ -34,7 +34,7 @@
/**
* Get the virtual file root.
*
- * @param url the root URL
+ * @param url the root URL
* @param parentDepth level of parent depth
* @return actual virtual file from url param
* @throws IOException for any error
@@ -53,7 +53,7 @@
URL vfsurl = null;
String relative;
File fp = new File(file);
-
+
log.trace("File: " + fp);
if (fp.exists())
@@ -83,7 +83,7 @@
VirtualFile top = VFS.getRoot(vfsurl);
top = top.getChild(relative);
- while(parentDepth > 0)
+ while (parentDepth > 0)
{
if (top == null)
throw new IllegalArgumentException("Null parent: " + vfsurl + ", relative: " + relative);
@@ -149,31 +149,45 @@
{
if (root.isLeaf())
{
- touchTimestamp(root);
- handleItem(root.getPathName());
+ touchTimestamp(root);
+ handleItemIgnoreErrors(root.getPathName());
}
else
{
String rootPathName = root.getPathName();
int rootPathNameLength = rootPathName.length();
- List<VirtualFile> children = root.getChildrenRecursively();
+ List<VirtualFile> children = root.getChildrenRecursively(LeafVirtualFileFilter.INSTANCE);
for (VirtualFile child : children)
{
- if (child.isLeaf())
- {
- String name = child.getPathName();
- // move past '/'
- int length = rootPathNameLength;
- if (name.charAt(length) == '/')
- length++;
- touchTimestamp(child);
- handleItem(name.substring(length));
- }
+ String name = child.getPathName();
+ // move past '/'
+ int length = rootPathNameLength;
+ if (name.charAt(length) == '/')
+ length++;
+ touchTimestamp(child);
+ handleItemIgnoreErrors(name.substring(length));
}
}
}
/**
+ * Handle item, ignore any errors.
+ *
+ * @param name the item name
+ */
+ protected void handleItemIgnoreErrors(String name)
+ {
+ try
+ {
+ handleItem(name);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error handling item: " + name, t);
+ }
+ }
+
+ /**
* Update timestamp.
*
* @param file the file to check
@@ -187,9 +201,9 @@
timestamp = lastModified;
}
}
-
+
@Override
- public long getTimestamp()
+ public long getTimestamp()
{
return timestamp;
}
Modified: projects/jboss-seam-int/trunk/pom.xml
===================================================================
--- projects/jboss-seam-int/trunk/pom.xml 2008-10-24 07:07:49 UTC (rev 80016)
+++ projects/jboss-seam-int/trunk/pom.xml 2008-10-24 07:49:21 UTC (rev 80017)
@@ -27,17 +27,17 @@
</modules>
<properties>
- <version.jboss.seam>2.1.1-SNAPSHOT</version.jboss.seam>
+ <version.jboss.seam>2.1.0.GA</version.jboss.seam>
<version.jboss.vfs>2.0.0.CR1</version.jboss.vfs>
- <version.jboss.man>2.0.0.CR1</version.jboss.man>
+ <version.jboss.man>2.0.0.CR2</version.jboss.man>
<version.jboss.microcontainer>2.0.0.CR2</version.jboss.microcontainer>
<version.jboss.cl>2.0.0.CR3</version.jboss.cl>
<version.jboss.deployers>2.0.0.CR2</version.jboss.deployers>
- <version.jboss.common.core>2.2.5.GA</version.jboss.common.core>
+ <version.jboss.common.core>2.2.8.GA</version.jboss.common.core>
<version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
<version.jboss.classloading.spi>5.0.0.CR2</version.jboss.classloading.spi>
- <version.jboss.metadata>1.0.0.Beta38</version.jboss.metadata>
- <version.jbossxb>2.0.0.CR15</version.jbossxb>
+ <version.jboss.metadata>1.0.0.CR3</version.jboss.metadata>
+ <version.jbossxb>2.0.0.GA</version.jbossxb>
<version.servlet.api>2.5</version.servlet.api>
<version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
<version.junit>4.4</version.junit>
More information about the jboss-cvs-commits
mailing list