Author: deepal
Date: Tue Dec 18 00:03:49 2007
New Revision: 11335

Log:

doing the changes suggested by Sanjiva 

Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
   
trunk/registry/modules/core/src/main/resources/org/wso2/registry/i18n/resource.properties

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
 (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/RemoteRegistry.java
 Tue Dec 18 00:03:49 2007
@@ -51,7 +51,7 @@
      * NOTE : Should not have "/" after the wso2registry part
      *
      * @param registryURL : URL to the registry
-     * @throws RegistryException
+     * @throws RegistryException : If something went wrong
      */
     public RemoteRegistry(URL registryURL) throws RegistryException {
         String url = registryURL.toString();
@@ -450,16 +450,34 @@
         return logs;
     }
 
-    public void exportToRegistry(File file, String path) throws 
RegistryException {
+    /**
+     * This method can be used to export a local file system into a runing 
instanse of a registry.
+     * Need to create a file object representing the local file and the need 
to tell where to add
+     * the resource in the registry.
+     * @param file : File representing local file system
+     * @param path : Where to put the file
+     * @throws RegistryException : if something went wrong
+     */
+    public void importToRegistry(File file, String path) throws 
RegistryException {
         try {
+            if (file == null || path == null) {
+                throw new 
RegistryException(Messages.getMessage("file.valaue.null"));
+            }
             processImport(file, path);
         } catch (Exception e) {
-            e.printStackTrace();
             throw new RegistryException(e.getMessage());
         }
     }
 
-    public void importFromRegistry(File toFile, String path) throws 
RegistryException {
+    /**
+     * This method can be used to export registry instance or node in a 
regsitry to a local file
+     * system. When we call this method a file srcuture will be created to 
match the structure to
+     * map the strcuture in the registry
+     * @param toFile : File in the local file system
+     * @param path : To which node export
+     * @throws RegistryException : If something went wrong
+     */
+    public void exportFromRegistry(File toFile, String path) throws 
RegistryException {
         try {
             processExport(path, toFile);
         } catch (Exception e) {

Modified: 
trunk/registry/modules/core/src/main/resources/org/wso2/registry/i18n/resource.properties
==============================================================================
--- 
trunk/registry/modules/core/src/main/resources/org/wso2/registry/i18n/resource.properties
   (original)
+++ 
trunk/registry/modules/core/src/main/resources/org/wso2/registry/i18n/resource.properties
   Tue Dec 18 00:03:49 2007
@@ -73,6 +73,7 @@
 inputstream.null=could not create an inputstream for the file {0}
 dbname.null=dbconfig configuration in registry.xml must have the name attribute
 error.creating.file=Unable to create file {0}.
+file.valaue.null=Either file or path is null
 ################################ APP Messages 
###########################################
 resource.version=Resource Version for the resource {0}
 resource.not.found=Resource Not found.

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to