directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r545736 - in /directory/studio/trunk/studio-ldapbrowser-core: .classpath META-INF/MANIFEST.MF build.properties ivy.xml src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java
Date Sat, 09 Jun 2007 12:15:43 GMT
Author: seelmann
Date: Sat Jun  9 05:15:42 2007
New Revision: 545736

URL: http://svn.apache.org/viewvc?view=rev&rev=545736
Log:
DIRSTUDIO-130: Added conversion of old connections.xml to new store location and package names

Modified:
    directory/studio/trunk/studio-ldapbrowser-core/.classpath
    directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF
    directory/studio/trunk/studio-ldapbrowser-core/build.properties
    directory/studio/trunk/studio-ldapbrowser-core/ivy.xml
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java

Modified: directory/studio/trunk/studio-ldapbrowser-core/.classpath
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/.classpath?view=diff&rev=545736&r1=545735&r2=545736
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/.classpath (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/.classpath Sat Jun  9 05:15:42 2007
@@ -3,6 +3,7 @@
 	<classpathentry kind="src" path="src/main/java"/>
 	<classpathentry kind="src" path="src/main/resources"/>
 	<classpathentry kind="src" path="src/test/java"/>
+	<classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
 	<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
 	<classpathentry kind="lib" path="lib/poi-2.5.1-final-20040804.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>

Modified: directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF?view=diff&rev=545736&r1=545735&r2=545736
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/META-INF/MANIFEST.MF Sat Jun  9 05:15:42
2007
@@ -28,4 +28,5 @@
  org.apache.directory.studio.ldapbrowser.core.utils
 Bundle-ClassPath: .,
  lib/commons-codec-1.3.jar,
+ lib/commons-io-1.3.1.jar,
  lib/poi-2.5.1-final-20040804.jar

Modified: directory/studio/trunk/studio-ldapbrowser-core/build.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/build.properties?view=diff&rev=545736&r1=545735&r2=545736
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/build.properties (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/build.properties Sat Jun  9 05:15:42 2007
@@ -7,4 +7,5 @@
                plugin.xml,\
                lib/,\
                about.html,\
-               about_files/
+               about_files/,\
+               lib/commons-io-1.3.1.jar

Modified: directory/studio/trunk/studio-ldapbrowser-core/ivy.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/ivy.xml?view=diff&rev=545736&r1=545735&r2=545736
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/ivy.xml (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/ivy.xml Sat Jun  9 05:15:42 2007
@@ -19,6 +19,7 @@
 <ivy-module version="1.0">
 	<info organisation="org.apache.directory.studio" module="studio-ldapbrowser-core"/>
 	<dependencies>
+		<dependency org="commons-io" name="commons-io" rev="1.3.1"/>
 		<dependency org="commons-codec" name="commons-codec" rev="1.3"/>
 		<dependency org="org.apache.poi" name="poi" rev="2.5.1-final-20040804"/>
     </dependencies>

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java?view=diff&rev=545736&r1=545735&r2=545736
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/ConnectionManager.java
Sat Jun  9 05:15:42 2007
@@ -36,6 +36,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.BookmarkUpdateListener;
 import org.apache.directory.studio.ldapbrowser.core.events.ConnectionRenamedEvent;
@@ -127,7 +128,31 @@
      */
     public static final String getConnectionStoreFileName()
     {
-        return BrowserCorePlugin.getDefault().getStateLocation().append( "connections.xml"
).toOSString(); //$NON-NLS-1$
+        String filename = BrowserCorePlugin.getDefault().getStateLocation().append( "connections.xml"
).toOSString(); //$NON-NLS-1$
+        File file = new File( filename );
+        if ( !file.exists() )
+        {
+            // try to convert old connections.xml
+            String oldFilename = filename.replaceAll( "org.apache.directory.studio.ldapbrowser.core",
+                "org.apache.directory.ldapstudio.browser.core" );
+            File oldFile = new File( oldFilename );
+            if ( oldFile.exists() )
+            {
+                try
+                {
+                    String oldContent = FileUtils.readFileToString( oldFile, "UTF-8" );
+                    String newContent = oldContent.replaceAll( "org.apache.directory.ldapstudio.browser.core",
+                        "org.apache.directory.studio.ldapbrowser.core" );
+                    FileUtils.writeStringToFile( file, newContent, "UTF-8" );
+                }
+                catch ( IOException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        return filename;
     }
 
 
@@ -257,8 +282,8 @@
     public void removeConnection( IConnection conn )
     {
         connectionList.remove( conn );
-        EventRegistry.fireConnectionUpdated(
-            new ConnectionUpdateEvent( conn, ConnectionUpdateEvent.EventDetail.CONNECTION_REMOVED
), this );
+        EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( conn,
+            ConnectionUpdateEvent.EventDetail.CONNECTION_REMOVED ), this );
     }
 
 



Mime
View raw message