Author: elecharny
Date: Sun Jan 24 08:38:17 2010
New Revision: 902534
URL: http://svn.apache.org/viewvc?rev=902534&view=rev
Log:
Fix for DIRSHARED-48
Modified:
directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java
Modified: directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java?rev=902534&r1=902533&r2=902534&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java
(original)
+++ directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java
Sun Jan 24 08:38:17 2010
@@ -52,11 +52,13 @@
{
HashMap<String,Boolean> retval = new HashMap<String,Boolean>();
String classPath = System.getProperty( "java.class.path", "." );
- String[] classPathElements = classPath.split( ":" );
+ String[] classPathElements = classPath.split( File.pathSeparator );
+
for ( String element : classPathElements )
{
getResources( retval, element, pattern );
}
+
return retval;
}
@@ -65,6 +67,7 @@
String element, Pattern pattern )
{
File file = new File( element );
+
if ( file.isDirectory() )
{
getResourcesFromDirectory( map, file, pattern );
@@ -80,6 +83,7 @@
File file, Pattern pattern )
{
ZipFile zf;
+
try
{
zf = new ZipFile( file );
@@ -94,11 +98,13 @@
}
Enumeration<? extends ZipEntry> e = zf.entries();
+
while ( e.hasMoreElements() )
{
ZipEntry ze = e.nextElement();
String fileName = ze.getName();
boolean accept = pattern.matcher( fileName ).matches();
+
if ( accept )
{
map.put( fileName, Boolean.TRUE );
@@ -119,6 +125,7 @@
HashMap<String,Boolean> map, File directory, Pattern pattern )
{
File[] fileList = directory.listFiles();
+
for ( File file : fileList )
{
if ( file.isDirectory() )
@@ -131,6 +138,7 @@
{
String fileName = file.getCanonicalPath();
boolean accept = pattern.matcher( fileName ).matches();
+
if ( accept )
{
map.put( fileName, Boolean.FALSE );
|