directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r555546 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io: OpenLdapSchemaFileImporter.java XMLSchemaFileImporter.java
Date Thu, 12 Jul 2007 09:32:19 GMT
Author: pamarcelot
Date: Thu Jul 12 02:32:16 2007
New Revision: 555546

URL: http://svn.apache.org/viewvc?view=rev&rev=555546
Log:
Modified the way to access to the schema name from a path.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileImporter.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/XMLSchemaFileImporter.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileImporter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileImporter.java?view=diff&rev=555546&r1=555545&r2=555546
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileImporter.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/OpenLdapSchemaFileImporter.java
Thu Jul 12 02:32:16 2007
@@ -137,18 +137,15 @@
      */
     private static final String getNameFromPath( String path )
     {
-        String separator = File.separator;
-
-        String[] splFileName = path.split( separator );
-        String fileNoPath = splFileName[splFileName.length - 1];
-
-        if ( fileNoPath.endsWith( ".schema" ) ) //$NON-NLS-1$
+        File file = new File( path );
+        String fileName = file.getName();
+        if ( fileName.endsWith( ".schema" ) ) //$NON-NLS-1$
         {
-            String[] fileName = fileNoPath.split( "\\." ); //$NON-NLS-1$
-            return fileName[0];
+            String[] fileNameSplitted = fileName.split( "\\." ); //$NON-NLS-1$
+            return fileNameSplitted[0];
         }
 
-        return fileNoPath;
+        return fileName;
     }
 
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/XMLSchemaFileImporter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/XMLSchemaFileImporter.java?view=diff&rev=555546&r1=555545&r2=555546
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/XMLSchemaFileImporter.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/io/XMLSchemaFileImporter.java
Thu Jul 12 02:32:16 2007
@@ -170,18 +170,15 @@
      */
     private static final String getNameFromPath( String path )
     {
-        String separator = File.separator;
-
-        String[] splFileName = path.split( separator );
-        String fileNoPath = splFileName[splFileName.length - 1];
-
-        if ( fileNoPath.endsWith( ".xml" ) ) //$NON-NLS-1$
+        File file = new File( path );
+        String fileName = file.getName();
+        if ( fileName.endsWith( ".xml" ) ) //$NON-NLS-1$
         {
-            String[] fileName = fileNoPath.split( "\\." ); //$NON-NLS-1$
-            return fileName[0];
+            String[] fileNameSplitted = fileName.split( "\\." ); //$NON-NLS-1$
+            return fileNameSplitted[0];
         }
 
-        return fileNoPath;
+        return fileName;
     }
 
 



Mime
View raw message