[jboss-cvs] jboss-seam/src/main/org/jboss/seam/util ...
Gavin King
gavin.king at jboss.com
Tue Jun 19 15:02:37 EDT 2007
User: gavin
Date: 07/06/19 15:02:37
Modified: src/main/org/jboss/seam/util Resources.java
Removed: src/main/org/jboss/seam/util Parameters.java
Log:
repackaged built-in components
sorry for breakage, but it had to happen eventually :-(
Revision Changes Path
1.11 +18 -9 jboss-seam/src/main/org/jboss/seam/util/Resources.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Resources.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/util/Resources.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- Resources.java 19 Jun 2007 06:36:07 -0000 1.10
+++ Resources.java 19 Jun 2007 19:02:37 -0000 1.11
@@ -11,7 +11,8 @@
public class Resources
{
- public static InputStream getResourceAsStream(String resource) {
+ public static InputStream getResourceAsStream(String resource)
+ {
String stripped = resource.startsWith("/") ?
resource.substring(1) : resource;
@@ -35,7 +36,8 @@
return stream;
}
- public static InputStream getResourceAsStream(String resource, ServletContext servletContext) {
+ public static InputStream getResourceAsStream(String resource, ServletContext servletContext)
+ {
String stripped = resource.startsWith("/") ?
resource.substring(1) : resource;
@@ -59,13 +61,16 @@
{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
InputStream stream = null;
- if (classLoader!=null) {
+ if (classLoader!=null)
+ {
stream = classLoader.getResourceAsStream(stripped);
}
- if ( stream == null ) {
+ if ( stream == null )
+ {
stream = Seam.class.getResourceAsStream(resource);
}
- if ( stream == null ) {
+ if ( stream == null )
+ {
stream = Seam.class.getClassLoader().getResourceAsStream(stripped);
}
return stream;
@@ -93,7 +98,8 @@
return url;
}
- public static URL getResource(String resource, ServletContext servletContext) {
+ public static URL getResource(String resource, ServletContext servletContext)
+ {
String stripped = resource.startsWith("/") ?
resource.substring(1) : resource;
@@ -117,13 +123,16 @@
{
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
URL url = null;
- if (classLoader!=null) {
+ if (classLoader!=null)
+ {
url = classLoader.getResource(stripped);
}
- if ( url == null ) {
+ if ( url == null )
+ {
url = Seam.class.getResource(resource);
}
- if ( url == null ) {
+ if ( url == null )
+ {
url = Seam.class.getClassLoader().getResource(stripped);
}
return url;
More information about the jboss-cvs-commits
mailing list