juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1565360 - in /juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool: App.java Export.java Import.java
Date Thu, 06 Feb 2014 17:20:34 GMT
Author: alexoree
Date: Thu Feb  6 17:20:34 2014
New Revision: 1565360

URL: http://svn.apache.org/r1565360
Log:
JUDDI-839 adding export warning to prevent overwriting files

Modified:
    juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/App.java
    juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Export.java
    juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Import.java

Modified: juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/App.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/App.java?rev=1565360&r1=1565359&r2=1565360&view=diff
==============================================================================
--- juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/App.java
(original)
+++ juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/App.java
Thu Feb  6 17:20:34 2014
@@ -96,7 +96,7 @@ public class App {
                 System.out.println();
                 if (preserveOwnership) {
                     System.out.println("Next step(s), Edit the " + credFile + " and make
any adjustments that are necessary.");
-                    System.out.println("TIP: if you're using juddi, you temporarily switch
to the 'JuddiAuthenticator' which doesn't validate passwords.");
+                    System.out.println("TIP: if you're using juddi, you can temporarily switch
to the 'JuddiAuthenticator' which doesn't validate passwords.");
                 }
                 System.out.println("Next step(s), Edit " + config + " to point to the next
registry. Then try -import. You can also specify a different node.");
             }

Modified: juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Export.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Export.java?rev=1565360&r1=1565359&r2=1565360&view=diff
==============================================================================
--- juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Export.java
(original)
+++ juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Export.java
Thu Feb  6 17:20:34 2014
@@ -15,9 +15,9 @@
  */
 package org.apache.juddi.v3.migration.tool;
 
+import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.security.AuthProvider;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Properties;
@@ -29,7 +29,6 @@ import org.apache.juddi.api_v3.SavePubli
 import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.BusinessEntity;
@@ -140,6 +139,11 @@ public class Export {
         }
 
         private void ExportBusiness() throws Exception {
+                if (new File(businessfile).exists())
+                {
+                        System.err.println(businessfile + " already exists!");
+                        System.exit(1);
+                }
                 FileOutputStream fos = new FileOutputStream(businessfile);
                 FindBusiness req = new FindBusiness();
                 req.setAuthInfo(token);
@@ -212,6 +216,11 @@ public class Export {
         }
 
         private void ExportTmodels() throws Exception {
+                 if (new File(tmodelfile).exists())
+                {
+                        System.err.println(tmodelfile + " already exists!");
+                        System.exit(1);
+                }
                 FileOutputStream fos = new FileOutputStream(tmodelfile);
                 FindTModel req = new FindTModel();
                 req.setName(new Name(UDDIConstants.WILDCARD, null));
@@ -289,6 +298,11 @@ public class Export {
         }
 
         private void ExportPublishers() throws Exception {
+                 if (new File(publishersfile).exists())
+                {
+                        System.err.println(publishersfile + " already exists!");
+                        System.exit(1);
+                }
                 FileOutputStream fos = new FileOutputStream(publishersfile);
 
                 GetAllPublisherDetail r = new GetAllPublisherDetail();
@@ -317,6 +331,11 @@ public class Export {
                         }
                 }
                 mapping.put("usernames", sb.toString());
+                if (new File(mappingsfile).exists())
+                {
+                        System.err.println(mappingsfile + " already exists!");
+                        System.exit(1);
+                }
                 try {
                         FileOutputStream fos = new FileOutputStream(mappingsfile);
                         mapping.store(fos, "no comments");
@@ -333,6 +352,11 @@ public class Export {
                         String s = it.next();
                         p.setProperty(s, s);
                 }
+                if (new File(credFile).exists())
+                {
+                        System.err.println(credFile + " already exists!");
+                        System.exit(1);
+                }
                 try {
                         FileOutputStream fos = new FileOutputStream(credFile);
                         p.store(fos, "no comments");

Modified: juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Import.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Import.java?rev=1565360&r1=1565359&r2=1565360&view=diff
==============================================================================
--- juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Import.java
(original)
+++ juddi/trunk/uddi-migration-tool/src/main/java/org/apache/juddi/v3/migration/tool/Import.java
Thu Feb  6 17:20:34 2014
@@ -80,6 +80,7 @@ public class Import {
                 boolean preserveOwnership,
                 String mappingsfile, String credFile, boolean stripSig) throws Exception
{
 
+                this.safemode = safe;
                 this.credFile = credFile;
                 this.stripSig = stripSig;
                 this.publishersfile = publishersFile;
@@ -102,7 +103,7 @@ public class Import {
                 publish = transport.getUDDIPublishService();
                 inquiry = transport.getUDDIInquiryService();
                 juddi = transport.getJUDDIApiService();
-                String token = null;
+                token = null;
                 if (username == null || pass == null) {
                         username = clerk.getPublisher();
                         pass = clerk.getPassword();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message