r886 - in trunk: . coser-ui coser-ui/src/main/java/fr/ifremer/coser/ui/option
Author: echatellier Date: 2011-10-28 15:33:10 +0200 (Fri, 28 Oct 2011) New Revision: 886 Url: http://forge.codelutin.com/repositories/revision/coser/886 Log: Remove spring Modified: trunk/coser-ui/pom.xml trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/option/OptionHandler.java trunk/pom.xml Modified: trunk/coser-ui/pom.xml =================================================================== --- trunk/coser-ui/pom.xml 2011-10-27 15:15:16 UTC (rev 885) +++ trunk/coser-ui/pom.xml 2011-10-28 13:33:10 UTC (rev 886) @@ -108,10 +108,6 @@ <groupId>com.bbn</groupId> <artifactId>openmap</artifactId> </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - </dependency> </dependencies> <name>Coser :: UI</name> Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/option/OptionHandler.java =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/option/OptionHandler.java 2011-10-27 15:15:16 UTC (rev 885) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/option/OptionHandler.java 2011-10-28 13:33:10 UTC (rev 886) @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.net.URL; +import java.util.List; import javax.swing.JOptionPane; import javax.swing.tree.TreePath; @@ -38,8 +39,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.core.io.Resource; -import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.nuiton.util.Resource; import fr.ifremer.coser.CoserConfig; import fr.ifremer.coser.CoserConstants.Category; @@ -109,14 +109,13 @@ // ne match que dans coser try { - PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(Thread.currentThread().getContextClassLoader()); - Resource[] resources = resolver.getResources("classpath:/validators/fr/ifremer/coser/data/*.xml"); + List<URL> resources = Resource.getResources("validators/fr/ifremer/coser/data/.*\\.xml", + Thread.currentThread().getContextClassLoader()); if (log.isDebugEnabled()) { - log.debug("XML resources found : " + resources.length + " files"); + log.debug("XML resources found : " + resources.size() + " files"); } - for (Resource resource : resources) { - URL url = resource.getURL(); - String path = url.getPath(); + for (URL resource : resources) { + String path = resource.getPath(); String lastPath = path.substring(path.indexOf("/validators/") + "/validators/".length()); String folderPath = lastPath.substring(0, lastPath.lastIndexOf('/')); String name = lastPath.substring(lastPath.lastIndexOf('/') + 1); @@ -126,10 +125,10 @@ File validatorFile = new File(validatorDirectory, name); if (log.isDebugEnabled()) { - log.debug("Coping resources " + url + " to " + validatorFile.getAbsolutePath()); + log.debug("Coping resources " + resource + " to " + validatorFile.getAbsolutePath()); } - FileUtils.copyURLToFile(url, validatorFile); + FileUtils.copyURLToFile(resource, validatorFile); } } catch (IOException ex) { if (log.isErrorEnabled()) { Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-10-27 15:15:16 UTC (rev 885) +++ trunk/pom.xml 2011-10-28 13:33:10 UTC (rev 886) @@ -288,13 +288,6 @@ <version>2.3.18</version> <scope>compile</scope> </dependency> - - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>3.0.5.RELEASE</version> - <scope>compile</scope> - </dependency> </dependencies> </dependencyManagement>
participants (1)
-
echatellier@users.forge.codelutin.com