wicket git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/master 273902166 - 6b2a65b0f WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Add a check for scheme wsjar used by WebSphere. borrowed-from: https://github.com/ronmamo/reflections/pull/46/files Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6b2a65b0 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6b2a65b0 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6b2a65b0 Branch: refs/heads/master Commit: 6b2a65b0f62ab8cb11aeabdb2bd4c551f7433268 Parents: 2739021 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Tue Nov 11 15:09:53 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Tue Nov 11 15:09:53 2014 +0200 -- wicket-core/src/main/java/org/apache/wicket/Application.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/6b2a65b0/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index e592715..e6532d2 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -494,7 +494,7 @@ public abstract class Application implements UnboundListener, IEventSink URL metaInfWicket = wicketResources.next(); String protocol = metaInfWicket.getProtocol(); - if (jar.equals(protocol)) + if (jar.equals(protocol) || wsjar.equals(protocol)) { JarURLConnection jarURLConnection = (JarURLConnection) metaInfWicket.openConnection(); JarFile jarFile = jarURLConnection.getJarFile();
git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/master a9e82296a - 46684ffdf WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Add support for traversing JBoss' VFS Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/46684ffd Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/46684ffd Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/46684ffd Branch: refs/heads/master Commit: 46684ffdf5fa925976e1c10b89b8b754af152b6f Parents: a9e8229 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Wed Oct 15 11:40:38 2014 +0300 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Wed Oct 15 11:42:39 2014 +0300 -- .../java/org/apache/wicket/Application.java | 33 +++- 1 file changed, 32 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/46684ffd/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 2bd8462..e592715 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -16,6 +16,7 @@ */ package org.apache.wicket; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.net.JarURLConnection; @@ -31,6 +32,7 @@ import java.util.Properties; import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; +import java.util.jar.JarInputStream; import org.apache.wicket.application.ComponentInitializationListenerCollection; import org.apache.wicket.application.ComponentInstantiationListenerCollection; @@ -494,7 +496,7 @@ public abstract class Application implements UnboundListener, IEventSink if (jar.equals(protocol)) { - JarURLConnection jarURLConnection = (JarURLConnection) metaInfWicket.openConnection();; + JarURLConnection jarURLConnection = (JarURLConnection) metaInfWicket.openConnection(); JarFile jarFile = jarURLConnection.getJarFile(); EnumerationJarEntry jarEntries = jarFile.entries(); while (jarEntries.hasMoreElements()) @@ -513,6 +515,35 @@ public abstract class Application implements UnboundListener, IEventSink } } } + else if (vfs.equals(protocol)) + { // support for JBoss 6+ + URLConnection connection = metaInfWicket.openConnection(); + JarInputStream inputStream = (JarInputStream) connection.getInputStream(); + + int offset = 0; + JarEntry jarEntry; + while ((jarEntry = inputStream.getNextJarEntry()) != null) { + String jarEntryName = jarEntry.getName(); + int size = (int) jarEntry.getSize(); + if (jarEntryName.endsWith(PROPERTIES_FILE_EXTENSION)) + { + byte[] buf = new byte[size]; + int read = inputStream.read(buf, offset, size); + if (read == size) + { + Properties properties = new Properties(); + properties.load(new ByteArrayInputStream(buf)); + load(properties); + } + else + { + log.warn(Expected to read '{}' bytes from '{}' but actually read '{}', + size, jarEntryName, read); + } + } + offset += size; + } + } else if (file.equals(protocol)) { Folder metaInfWicketFolder = new
[2/4] git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d106598d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d106598d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d106598d Branch: refs/heads/master Commit: d106598d4e244122eb330ae84de9cdc6f0ac1413 Parents: e426267 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 13:00:16 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 13:00:16 2014 +0200 -- wicket-core/src/main/java/org/apache/wicket/Application.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/d106598d/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index f2fd258..5376284 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -508,6 +508,7 @@ public abstract class Application implements UnboundListener, IEventSink { properties.load(jarEntryStream); load(properties); + break; // atm there is no need to have more than one .properties file } } }
[1/4] git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/master a04e38d86 - 3f1e1dfe3 WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e4262674 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e4262674 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e4262674 Branch: refs/heads/master Commit: e4262674d6dd347fb51a1454c63e5f03ed5f135e Parents: 5837817 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 12:32:21 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 12:32:21 2014 +0200 -- .../wicket/osgi/OsgiClashingPackagesTest.java | 2 +- .../java/org/apache/wicket/Application.java | 97 +--- .../java/org/apache/wicket/IInitializer.java| 7 +- .../wicket/settings/FrameworkSettings.java | 2 +- wicket-core/src/main/java/wicket.properties | 15 --- .../wicket/org.apache.wicket.core.properties| 15 +++ wicket-devutils/src/main/java/wicket.properties | 15 --- .../org.apache.wicket.devutils.properties | 15 +++ .../org.apache.wicket.atmosphere.properties | 15 +++ .../src/main/resources/wicket.properties| 15 --- .../src/main/java/wicket.properties | 15 --- .../org.apache.wicket.extensions.properties | 15 +++ wicket-jmx/src/main/java/wicket.properties | 15 --- .../wicket/org.apache.wicket.jmx.properties | 15 +++ .../org/apache/wicket/velocity/Initializer.java | 11 +-- wicket-velocity/src/main/java/wicket.properties | 15 --- .../org.apache.wicket.velocity.properties | 15 +++ 17 files changed, 184 insertions(+), 115 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/e4262674/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java -- diff --git a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java index 993c8d4..6672cc6 100644 --- a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java +++ b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java @@ -153,7 +153,7 @@ public class OsgiClashingPackagesTest extends Assert entryName.startsWith(META-INF/) || // ignore Wicket's IInitializer conf files - (entryName.startsWith(wicket) entryName.endsWith(.properties)) + (entryName.startsWith(META-INF/wicket) entryName.endsWith(.properties)) ) { return false; http://git-wip-us.apache.org/repos/asf/wicket/blob/e4262674/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 999316d..f2fd258 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -18,20 +18,25 @@ package org.apache.wicket; import java.io.IOException; import java.io.InputStream; +import java.net.JarURLConnection; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.util.Collections; +import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; -import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.ComponentInitializationListenerCollection; import org.apache.wicket.application.ComponentInstantiationListenerCollection; import org.apache.wicket.application.ComponentOnAfterRenderListenerCollection; import org.apache.wicket.application.ComponentOnBeforeRenderListenerCollection; +import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.HeaderContributorListenerCollection; import org.apache.wicket.application.IComponentInitializationListener; import org.apache.wicket.application.IComponentInstantiationListener; @@ -98,6 +103,8 @@ import org.apache.wicket.settings.ResourceSettings; import org.apache.wicket.settings.SecuritySettings; import org.apache.wicket.settings.StoreSettings; import org.apache.wicket.util.IProvider; +import
[3/4] git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Minor improvements Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fa10aef3 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fa10aef3 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fa10aef3 Branch: refs/heads/master Commit: fa10aef39e23c0258738079e1d1ff90885175dc1 Parents: d106598 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 14:25:20 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 14:25:20 2014 +0200 -- .../main/java/org/apache/wicket/Application.java| 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/fa10aef3/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 5376284..2bd8462 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -105,7 +105,6 @@ import org.apache.wicket.settings.StoreSettings; import org.apache.wicket.util.IProvider; import org.apache.wicket.util.file.File; import org.apache.wicket.util.file.Folder; -import org.apache.wicket.util.io.IOUtils; import org.apache.wicket.util.io.Streams; import org.apache.wicket.util.lang.Args; import org.apache.wicket.util.lang.Generics; @@ -167,6 +166,8 @@ public abstract class Application implements UnboundListener, IEventSink /** Log. */ private static final Logger log = LoggerFactory.getLogger(Application.class); + private static final String PROPERTIES_FILE_EXTENSION = .properties; + /** root mapper */ private IRequestMapper rootRequestMapper; @@ -485,7 +486,7 @@ public abstract class Application implements UnboundListener, IEventSink */ private void collectWicketProperties() throws IOException, URISyntaxException { - IteratorURL wicketResources = getApplicationSettings().getClassResolver().getResources(META-INF/wicket); + IteratorURL wicketResources = getApplicationSettings().getClassResolver().getResources(META-INF/wicket/); while (wicketResources.hasNext()) { URL metaInfWicket = wicketResources.next(); @@ -493,8 +494,7 @@ public abstract class Application implements UnboundListener, IEventSink if (jar.equals(protocol)) { - URLConnection urlConnection = metaInfWicket.openConnection(); - JarURLConnection jarURLConnection = (JarURLConnection) urlConnection; + JarURLConnection jarURLConnection = (JarURLConnection) metaInfWicket.openConnection();; JarFile jarFile = jarURLConnection.getJarFile(); EnumerationJarEntry jarEntries = jarFile.entries(); while (jarEntries.hasMoreElements()) @@ -503,9 +503,9 @@ public abstract class Application implements UnboundListener, IEventSink String entryName = jarEntry.getName(); if (entryName.startsWith(META-INF/wicket/) entryName.endsWith(.properties)) { - Properties properties = new Properties(); try (InputStream jarEntryStream = jarFile.getInputStream(jarEntry)) { + Properties properties = new Properties(); properties.load(jarEntryStream); load(properties); break; // atm there is no need to have more than one .properties file @@ -522,14 +522,14 @@ public abstract class Application implements UnboundListener, IEventSink public boolean accept(File file) { String fileName = file.getAbsolutePath(); - return fileName.contains(/META-INF/wicket/) fileName.endsWith(.properties); + return fileName.contains(/META-INF/wicket/) fileName.endsWith(PROPERTIES_FILE_EXTENSION);
git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/WICKET-5713-meta-inf-wicket [created] e4262674d WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/e4262674 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/e4262674 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/e4262674 Branch: refs/heads/WICKET-5713-meta-inf-wicket Commit: e4262674d6dd347fb51a1454c63e5f03ed5f135e Parents: 5837817 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 12:32:21 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 12:32:21 2014 +0200 -- .../wicket/osgi/OsgiClashingPackagesTest.java | 2 +- .../java/org/apache/wicket/Application.java | 97 +--- .../java/org/apache/wicket/IInitializer.java| 7 +- .../wicket/settings/FrameworkSettings.java | 2 +- wicket-core/src/main/java/wicket.properties | 15 --- .../wicket/org.apache.wicket.core.properties| 15 +++ wicket-devutils/src/main/java/wicket.properties | 15 --- .../org.apache.wicket.devutils.properties | 15 +++ .../org.apache.wicket.atmosphere.properties | 15 +++ .../src/main/resources/wicket.properties| 15 --- .../src/main/java/wicket.properties | 15 --- .../org.apache.wicket.extensions.properties | 15 +++ wicket-jmx/src/main/java/wicket.properties | 15 --- .../wicket/org.apache.wicket.jmx.properties | 15 +++ .../org/apache/wicket/velocity/Initializer.java | 11 +-- wicket-velocity/src/main/java/wicket.properties | 15 --- .../org.apache.wicket.velocity.properties | 15 +++ 17 files changed, 184 insertions(+), 115 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/e4262674/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java -- diff --git a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java index 993c8d4..6672cc6 100644 --- a/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java +++ b/testing/wicket-common-tests/src/test/java/org/apache/wicket/osgi/OsgiClashingPackagesTest.java @@ -153,7 +153,7 @@ public class OsgiClashingPackagesTest extends Assert entryName.startsWith(META-INF/) || // ignore Wicket's IInitializer conf files - (entryName.startsWith(wicket) entryName.endsWith(.properties)) + (entryName.startsWith(META-INF/wicket) entryName.endsWith(.properties)) ) { return false; http://git-wip-us.apache.org/repos/asf/wicket/blob/e4262674/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 999316d..f2fd258 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -18,20 +18,25 @@ package org.apache.wicket; import java.io.IOException; import java.io.InputStream; +import java.net.JarURLConnection; +import java.net.URISyntaxException; import java.net.URL; import java.net.URLConnection; import java.util.Collections; +import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; -import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.ComponentInitializationListenerCollection; import org.apache.wicket.application.ComponentInstantiationListenerCollection; import org.apache.wicket.application.ComponentOnAfterRenderListenerCollection; import org.apache.wicket.application.ComponentOnBeforeRenderListenerCollection; +import org.apache.wicket.application.ComponentOnConfigureListenerCollection; import org.apache.wicket.application.HeaderContributorListenerCollection; import org.apache.wicket.application.IComponentInitializationListener; import org.apache.wicket.application.IComponentInstantiationListener; @@ -98,6 +103,8 @@ import org.apache.wicket.settings.ResourceSettings; import org.apache.wicket.settings.SecuritySettings; import org.apache.wicket.settings.StoreSettings; import
git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/WICKET-5713-meta-inf-wicket e4262674d - d106598d4 WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/d106598d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/d106598d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/d106598d Branch: refs/heads/WICKET-5713-meta-inf-wicket Commit: d106598d4e244122eb330ae84de9cdc6f0ac1413 Parents: e426267 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 13:00:16 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 13:00:16 2014 +0200 -- wicket-core/src/main/java/org/apache/wicket/Application.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/d106598d/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index f2fd258..5376284 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -508,6 +508,7 @@ public abstract class Application implements UnboundListener, IEventSink { properties.load(jarEntryStream); load(properties); + break; // atm there is no need to have more than one .properties file } } }
git commit: WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties
Repository: wicket Updated Branches: refs/heads/WICKET-5713-meta-inf-wicket d106598d4 - fa10aef39 WICKET-5713 Move /wicket.properties to /META-INF/wicket/xyz.properties Minor improvements Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fa10aef3 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fa10aef3 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fa10aef3 Branch: refs/heads/WICKET-5713-meta-inf-wicket Commit: fa10aef39e23c0258738079e1d1ff90885175dc1 Parents: d106598 Author: Martin Tzvetanov Grigorov mgrigo...@apache.org Authored: Thu Oct 2 14:25:20 2014 +0200 Committer: Martin Tzvetanov Grigorov mgrigo...@apache.org Committed: Thu Oct 2 14:25:20 2014 +0200 -- .../main/java/org/apache/wicket/Application.java| 16 1 file changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/wicket/blob/fa10aef3/wicket-core/src/main/java/org/apache/wicket/Application.java -- diff --git a/wicket-core/src/main/java/org/apache/wicket/Application.java b/wicket-core/src/main/java/org/apache/wicket/Application.java index 5376284..2bd8462 100644 --- a/wicket-core/src/main/java/org/apache/wicket/Application.java +++ b/wicket-core/src/main/java/org/apache/wicket/Application.java @@ -105,7 +105,6 @@ import org.apache.wicket.settings.StoreSettings; import org.apache.wicket.util.IProvider; import org.apache.wicket.util.file.File; import org.apache.wicket.util.file.Folder; -import org.apache.wicket.util.io.IOUtils; import org.apache.wicket.util.io.Streams; import org.apache.wicket.util.lang.Args; import org.apache.wicket.util.lang.Generics; @@ -167,6 +166,8 @@ public abstract class Application implements UnboundListener, IEventSink /** Log. */ private static final Logger log = LoggerFactory.getLogger(Application.class); + private static final String PROPERTIES_FILE_EXTENSION = .properties; + /** root mapper */ private IRequestMapper rootRequestMapper; @@ -485,7 +486,7 @@ public abstract class Application implements UnboundListener, IEventSink */ private void collectWicketProperties() throws IOException, URISyntaxException { - IteratorURL wicketResources = getApplicationSettings().getClassResolver().getResources(META-INF/wicket); + IteratorURL wicketResources = getApplicationSettings().getClassResolver().getResources(META-INF/wicket/); while (wicketResources.hasNext()) { URL metaInfWicket = wicketResources.next(); @@ -493,8 +494,7 @@ public abstract class Application implements UnboundListener, IEventSink if (jar.equals(protocol)) { - URLConnection urlConnection = metaInfWicket.openConnection(); - JarURLConnection jarURLConnection = (JarURLConnection) urlConnection; + JarURLConnection jarURLConnection = (JarURLConnection) metaInfWicket.openConnection();; JarFile jarFile = jarURLConnection.getJarFile(); EnumerationJarEntry jarEntries = jarFile.entries(); while (jarEntries.hasMoreElements()) @@ -503,9 +503,9 @@ public abstract class Application implements UnboundListener, IEventSink String entryName = jarEntry.getName(); if (entryName.startsWith(META-INF/wicket/) entryName.endsWith(.properties)) { - Properties properties = new Properties(); try (InputStream jarEntryStream = jarFile.getInputStream(jarEntry)) { + Properties properties = new Properties(); properties.load(jarEntryStream); load(properties); break; // atm there is no need to have more than one .properties file @@ -522,14 +522,14 @@ public abstract class Application implements UnboundListener, IEventSink public boolean accept(File file) { String fileName = file.getAbsolutePath(); - return fileName.contains(/META-INF/wicket/) fileName.endsWith(.properties); +