コード例 #1
0
  private static void initializeRuntimesFromDefinitionFile(IProgressMonitor monitor) {
    final Set<RuntimePath> runtimePaths = parseRuntimeLocationsFile();
    for (RuntimePath runtimePath : runtimePaths) {
      RuntimeInitializerUtil.createRuntimeDefinitions(runtimePath, monitor);
    }

    if (runtimePaths.size() > 0) {
      HashSet<RuntimePath> set =
          new HashSet<RuntimePath>(
              Arrays.asList(RuntimeUIActivator.getDefault().getModel().getRuntimePaths()));
      set.addAll(runtimePaths);
      RuntimeUIActivator.getDefault()
          .getModel()
          .setRuntimePaths(set.toArray(new RuntimePath[set.size()]));
    }
  }
コード例 #2
0
 private static File getRelativeDirectory(String dir) {
   try {
     String configuration = getConfiguration();
     File directory = new File(configuration, dir);
     return directory;
   } catch (IOException ioe) {
     RuntimeUIActivator.pluginLog().logError(ioe);
   }
   return null;
 }
コード例 #3
0
 private static void initializeUserHomeRuntimes(IProgressMonitor monitor) {
   String userHome = System.getProperty(USER_HOME);
   if (userHome != null) {
     File directory = new File(userHome, JBOSS_RUNTIMES);
     if (directory.isDirectory()) {
       RuntimeInitializerUtil.initializeRuntimesFromFolder(directory, monitor);
     }
     RuntimePath path = new RuntimePath(directory.getAbsolutePath());
     path.setScanOnEveryStartup(true);
     RuntimeUIActivator.getDefault().getModel().addRuntimePath(path);
   }
 }
コード例 #4
0
  private static File findRuntimeFile() {
    try {
      String pluginLocation =
          FileLocator.resolve(RuntimeUIActivator.getDefault().getBundle().getEntry("/"))
              .getPath(); //$NON-NLS-1$
      File serversFile = new File(pluginLocation, LOCATIONS_FILE);

      if (!serversFile.isFile()) {
        String configuration = getConfiguration();
        serversFile = new File(configuration, LOCATIONS_FILE_CONFIGURATION).getCanonicalFile();
      } else {
        serversFile = serversFile.getCanonicalFile();
      }
      if (!serversFile.isFile()) {
        serversFile = new File(pluginLocation, LOCATIONS_FILE_NAME);
      }
      if (serversFile.isFile()) {
        return serversFile;
      }
    } catch (IOException ioe) {
      RuntimeUIActivator.pluginLog().logError(ioe);
    }
    return null;
  }