Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path


  public boolean performFinish() {
    WGARuntime runtime = _page.getRuntime();   
    if(runtime != null){
      try {
        IFolder folder = runtime.getDesignRoot().getFolder(new Path(_page.getDesignName()));
        if (!folder.exists()) {
          folder.create(false, true, new NullProgressMonitor());
          DesignTemplate template = _page.getTemplate();
          WGADesignFactory.createDesign(folder, folder.getName(), template);
         
View Full Code Here


    File libDir = new File(_deployment.getDeployDir(), "WEB-INF/lib");
    File classesDir = new File(_deployment.getDeployDir(), "WEB-INF/classes");
    File isolatedDir = new File(_deployment.getDeployDir(), "WEB-INF/isolated");
    if (!_deployment.isWorkspaceDeployment()) {     
      entries.addAll(DirectoryLibrarySet.retrieveClasspathEntries(libDir));          
      entries.add(JavaCore.newLibraryEntry(new Path(classesDir.getAbsolutePath()) , new Path(""), null));         
      entries.addAll(DirectoryLibrarySet.retrieveClasspathEntries(isolatedDir));
    } else {
      entries.addAll(retrieveClasspathEntries(libDir));
      BeanMapPreferencesStore<IPath, LibraryClasspathEntryInformation> store = WGADesignerPlugin.getDefault().getLibraryClasspathEntryInformationStore();
      store.load();
      if (!store.getBeans().containsKey(new Path(classesDir.getAbsolutePath()))) {
        LibraryClasspathEntryInformation info = new LibraryClasspathEntryInformation();
        info.setSourcePath(new Path("/WGAPublisher/JavaSource"));
        store.getBeans().put(new Path(classesDir.getAbsolutePath()), info);
        store.flush();
      }     
      entries.add(JavaCore.newLibraryEntry(new Path(classesDir.getAbsolutePath()) , null, null));   
      entries.addAll(retrieveClasspathEntries(isolatedDir));     
    }
   
    return entries.toArray(new IClasspathEntry[0]);
  }
View Full Code Here

    if (libs != null) {         
      BeanMapPreferencesStore<IPath, LibraryClasspathEntryInformation> store = WGADesignerPlugin.getDefault().getLibraryClasspathEntryInformationStore();
      store.load();
      Map<IPath, LibraryClasspathEntryInformation> infos = store.getBeans();
      for( File lib: libs ) {
        IClasspathEntry entry = JavaCore.newLibraryEntry(new Path(lib.getAbsolutePath()), null, null);
        IPath srcPath = jarToProjectSource.get(lib.getName());
        if (srcPath != null) {
          if (!infos.containsKey(new Path(lib.getAbsolutePath()))) {
            LibraryClasspathEntryInformation info = new LibraryClasspathEntryInformation();
            info.setSourcePath(srcPath);
            store.getBeans().put(entry.getPath(), info);
          }
        }
View Full Code Here

    for (IClasspathEntry entry : entries) {
      // check if we have additional infos for this entry
      LibraryClasspathEntryInformation info = infos.get(entry.getPath());
      if (info != null) {
        IPath srcPath = info.getSourcePath();
        IPath srcRoot = new Path("/");
        if (srcPath == null) {
          srcPath = new Path("");
          srcRoot = null;
        }
       
        entryList.add(JavaCore.newLibraryEntry(entry.getPath(), srcPath, srcRoot, new IAccessRule[0], info.getAttributes(), false));
      } else {
        entryList.add(JavaCore.newLibraryEntry(entry.getPath(), new Path(""), null));
      }
    }
    return entryList.toArray(new IClasspathEntry[0]);
  }
View Full Code Here

      for( File lib: libs ) {
          // strip off the file extension
          String ext = lib.getName().split("[.]")[1];
          // now see if this archive has an associated src jar
          File srcArc = new File(lib.getAbsolutePath().replace("."+ext, "-src."+ext));
          Path srcPath = null;
          // if the source archive exists then get the path to attach it
          if( srcArc.exists()) {
              srcPath = new Path(srcArc.getAbsolutePath());
          }
          // create a new CPE_LIBRARY type of cp entry with an attached source
          // archive if it exists
          entryList.add(JavaCore.newLibraryEntry(new Path(lib.getAbsolutePath()) , srcPath, new Path("/")));
      }
   
    }
    return entryList;
  }
View Full Code Here

    IFolder pluginDBs = FileUtils.createFolder(plugins, PLUGIN_DBS_FOLDERNAME);
    pluginDBs.setDerived(true);
    IFolder pluginWorkspace = FileUtils.createFolder(plugins, PLUGIN_WORKSPACE_FOLDERNAME);
    pluginWorkspace.setDerived(true);

    _hsqlRoot = _wgaData.getFolder(new Path(DBS_FOLDERNAME));
    IFolder oldHSQLRoot = _wgaData.getFolder(new Path("dbs"));
    if (oldHSQLRoot.exists()) {
      try {
        oldHSQLRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldHSQLRoot.move(new Path(DBS_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing dbs folder.", e);
      }
    }
    if (!_hsqlRoot.exists()) {
      _hsqlRoot.create(false, true, new NullProgressMonitor());
    }
    _hsqlRoot.setDerived(true);

    _luceneRoot = _wgaData.getFolder(new Path(LUCENE_FOLDERNAME));
    IFolder oldLuceneRoot = _wgaData.getFolder(new Path("lucene"));
    if (oldLuceneRoot.exists()) {
      try {
        oldLuceneRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldLuceneRoot.move(new Path(LUCENE_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing lucene folder.", e);
      }
    }
    if (!_luceneRoot.exists()) {
View Full Code Here

    }
  }

  private void init() {
    _catalinaBase = _project.getFolder("tomcat");
    _catalinaConf = _catalinaBase.getFolder(new Path(CATALINA_CONF_DIRNAME));
    _catalinaLibdir = _catalinaBase.getFolder(new Path("lib"));
    if(!_catalinaLibdir.exists()){
        try {
                FileUtils.createFolder(_catalinaBase, "lib");
            }
            catch (CoreException e) {
                Plugin.getDefault().logError("Unable to create folder : " + _catalinaLibdir.toString(), e);
            }
    }
       

    _wgaBase = _project.getFolder("wga");
    _wgaData = _wgaBase.getFolder(new Path("wgadata"));
    if(!_wgaData.exists()){
        try {
                FileUtils.createFolder(_wgaBase,"wgadata");
            }
            catch (CoreException e) {
                Plugin.getDefault().logError("Unable to create folder : " + _wgaData.toString(), e);
            }
    }
   

    IFolder plugins = _wgaData.getFolder(new Path("plugins"));
    if (plugins.exists()) {
      IFolder pluginDBs = plugins.getFolder(PLUGIN_DBS_FOLDERNAME);
      if (pluginDBs.exists()) {
        try {
          pluginDBs.setDerived(true);
        } catch (CoreException e1) {
          WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + pluginDBs.getLocation() + "'.", e1);
        }
      }
      IFolder pluginWorkspace = plugins.getFolder(PLUGIN_WORKSPACE_FOLDERNAME);
      if (pluginWorkspace.exists()) {
        try {
          pluginWorkspace.setDerived(true);
        } catch (CoreException e1) {
          WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + pluginWorkspace.getLocation() + "'.", e1);
        }
      }
    }

    _workflowRoot = _wgaData.getFolder(new Path("workflows"));
    _designRoot = _project.getFolder("designs");

    _hsqlRoot = _wgaData.getFolder(new Path(DBS_FOLDERNAME));
    IFolder oldHSQLRoot = _wgaData.getFolder(new Path("dbs"));
    if (oldHSQLRoot.exists() && !_hsqlRoot.exists()) {
      try {
        oldHSQLRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldHSQLRoot.move(new Path(DBS_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing dbs folder.", e);
      }
    }
    try {
        if(!_hsqlRoot.exists()){
            FileUtils.createFolder(_wgaData, DBS_FOLDERNAME);
        }
      _hsqlRoot.setDerived(true);
    } catch (CoreException e1) {
      WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + _hsqlRoot.getLocation() + "'.", e1);
    }

    _luceneRoot = _wgaData.getFolder(new Path(LUCENE_FOLDERNAME));
    IFolder oldLuceneRoot = _wgaData.getFolder(new Path("lucene"));
    if (oldLuceneRoot.exists() && !_luceneRoot.exists()) {
      try {
        oldLuceneRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldLuceneRoot.move(new Path(LUCENE_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing lucene folder.", e);
      }
    }
    try {
View Full Code Here

    Iterator<ContentStore> itCS = retrieveWGAConfig(false).getContentStores().iterator();
    while (itCS.hasNext()) {
      ContentStore currentContentStore = itCS.next();
      Design currentDesign = currentContentStore.getDesign();
      if (currentDesign != null && currentDesign.getSource() != null && currentContentStore.isEnabled() && currentDesign.getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
        IFolder designFolder = getDesignRoot().getFolder(new Path(currentDesign.getName()));
        if (WGADesignStructureHelper.isDirlinkFolder(designFolder)) {
          contentDesign.put(currentContentStore.getKey(), (WGADesignStructureHelper.dirLinkFolderToContainer(designFolder)));
        } else {
          contentDesign.put(currentContentStore.getKey(), designFolder);
        }
View Full Code Here

      }
    }
  }

  public void registerExternalDesign(WGADesign wgaDesign) throws IOException, CoreException {
    IFolder designFolder = getDesignRoot().getFolder(new Path(wgaDesign.getName()));
    if (!designFolder.exists()) {
      designFolder.create(false, true, new NullProgressMonitor());
      createDirlink(wgaDesign, designFolder);
      getDesignRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
    }
View Full Code Here

    synchronized (_wgaConfigLock) {

      FileOutputStream wgaxmlstream = null;
      try {
          IFile wgaConfig = getWGABase().getFile(new Path("wgaconfig.xml"));
          if (wgaConfig.exists() && wgaConfig.isReadOnly()) {
                    ResourceAttributes attributes = wgaConfig.getResourceAttributes();
                    attributes.setReadOnly(false);
                    wgaConfig.setResourceAttributes(attributes);               
          }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Path

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.