protected void setupBaseDir() {
   String path = LdiResourceUtil.getResourcePath(referenceClass);
   URL url = LdiResourceUtil.getResource(path);
   String fileName = null;
   if ("zip".equals(url.getProtocol())) {
     fileName = LdiZipFileUtil.toZipFilePath(url);
   } else {
     fileName = LdiJarFileUtil.toJarFilePath(url);
   }
   File jarFile = new File(fileName);
   File dir = jarFile.getParentFile();
   setBaseDir(LdiFileUtil.getCanonicalPath(dir));
 }
Esempio n. 2
0
 public static synchronized void configure(String configFile) {
   if (configuring) {
     return;
   }
   configuring = true;
   initializeDefaultProviderIfNeeds();
   initializeDefaultBuilderIfNeeds();
   if (LdiResourceUtil.isExist(configFile)) {
     doConfigure(configFile);
   }
   DisposableUtil.add(
       new Disposable() {
         public void dispose() {
           LaContainerFactory.destroy();
         }
       });
   configuring = false;
   initialized = true;
 }