]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/internal/runtime/InitUtils.java
Introduce directory content provider
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / runtime / InitUtils.java
index 70ea9ec486e6838f526c5de3b6733eb0a93a5364..821808017644b9dcd17089cd426809b2d73c7a66 100644 (file)
@@ -182,7 +182,8 @@ public class InitUtils {
                        // TODO downgrade security level
                }
                for (String userAdminUri : userAdminUris.split(" "))
-                       uris.add(userAdminUri);
+                       if (!userAdminUri.trim().equals(""))
+                               uris.add(userAdminUri);
 
                // Interprets URIs
                for (String uri : uris) {
@@ -238,15 +239,17 @@ public class InitUtils {
                                // TODO also uncompress archives
                                if (initDir.exists())
                                        try {
-                                               FileUtils.copyDirectory(initDir, KernelUtils.getOsgiInstanceDir(), new FileFilter() {
+                                               // TODO use NIO utilities
+                                               FileUtils.copyDirectory(initDir, KernelUtils.getOsgiInstancePath("").toFile(),
+                                                               new FileFilter() {
 
-                                                       @Override
-                                                       public boolean accept(File pathname) {
-                                                               if (pathname.getName().equals(".svn") || pathname.getName().equals(".git"))
-                                                                       return false;
-                                                               return true;
-                                                       }
-                                               });
+                                                                       @Override
+                                                                       public boolean accept(File pathname) {
+                                                                               if (pathname.getName().equals(".svn") || pathname.getName().equals(".git"))
+                                                                                       return false;
+                                                                               return true;
+                                                                       }
+                                                               });
                                                log.info("CMS initialized from " + initDir.getCanonicalPath());
                                        } catch (IOException e) {
                                                throw new RuntimeException("Cannot initialize from " + initDir, e);