You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2007/03/25 11:07:41 UTC
svn commit: r522182 - in
/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples:
customresourceloading/CustomResourceLoadingApplication.java
hangman/WordGenerator.java
Author: jdonnerstag
Date: Sun Mar 25 02:07:40 2007
New Revision: 522182
URL: http://svn.apache.org/viewvc?view=rev&rev=522182
Log:
Localizer backport
Modified:
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/customresourceloading/CustomResourceLoadingApplication.java
incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/WordGenerator.java
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/customresourceloading/CustomResourceLoadingApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/customresourceloading/CustomResourceLoadingApplication.java?view=diff&rev=522182&r1=522181&r2=522182
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/customresourceloading/CustomResourceLoadingApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/customresourceloading/CustomResourceLoadingApplication.java Sun Mar 25 02:07:40 2007
@@ -27,11 +27,11 @@
import wicket.protocol.http.WebApplication;
import wicket.util.resource.IResourceStream;
import wicket.util.resource.UrlResourceStream;
-import wicket.util.resource.locator.AbstractResourceStreamLocator;
-import wicket.util.resource.locator.ClassLoaderResourceStreamLocator;
import wicket.util.resource.locator.IResourceStreamLocator;
+import wicket.util.resource.locator.ResourceStreamLocator;
import wicket.util.string.Strings;
+
/**
* Application class for the custom resource loading example.
*
@@ -45,20 +45,13 @@
/**
* Custom implementation of {@link IResourceStreamLocator}.
*/
- private final class CustomResourceStreamLocator extends AbstractResourceStreamLocator
+ private final class CustomResourceStreamLocator extends ResourceStreamLocator
{
/**
- * Locator to fallback on. Always a good idea to do this, because
- * packaged custom components etc <strong>will</strong> depend in this
- * loading.
- */
- private ClassLoaderResourceStreamLocator classLoaderLocator = new ClassLoaderResourceStreamLocator();
-
- /**
- * @see wicket.util.resource.locator.AbstractResourceStreamLocator#locate(java.lang.Class,
+ * @see wicket.util.resource.locator.ResourceStreamLocator#locate(java.lang.Class,
* java.lang.String)
*/
- protected IResourceStream locate(Class clazz, String path)
+ public IResourceStream locate(Class clazz, String path)
{
// Log attempt
if (log.isDebugEnabled())
@@ -98,7 +91,7 @@
}
// resource not found; fall back on class loading
- return classLoaderLocator.locate(clazz, path);
+ return super.locate(clazz, path);
}
}
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/WordGenerator.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/WordGenerator.java?view=diff&rev=522182&r1=522181&r2=522182
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/WordGenerator.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/WordGenerator.java Sun Mar 25 02:07:40 2007
@@ -26,7 +26,7 @@
import wicket.util.io.Streams;
import wicket.util.resource.IResourceStream;
import wicket.util.resource.ResourceStreamNotFoundException;
-import wicket.util.resource.locator.ClassLoaderResourceStreamLocator;
+import wicket.util.resource.locator.ResourceStreamLocator;
/**
* The word generator is responsible for reading in a list of words from a data
@@ -53,7 +53,7 @@
{
try
{
- final IResourceStream resource = new ClassLoaderResourceStreamLocator().locate(null,
+ final IResourceStream resource = new ResourceStreamLocator().locate(null,
"wicket/examples/hangman/WordList", "", Locale.getDefault(), ".txt");
final String wordlist = Streams.readString(resource.getInputStream());
this.words = Arrays.asList(wordlist.split("\\s+"));