Introduce static CMS.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / runtime / InitUtils.java
index 70ea9ec486e6838f526c5de3b6733eb0a93a5364..1ca5e4a553842600f18a7a911d0a4d881012235a 100644 (file)
@@ -238,15 +238,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);