Java Code Examples for org.eclipse.core.runtime.Path

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project Bio-PEPA, under directory /uk.ac.ed.inf.common/src/uk/ac/ed/inf/common/launching/.

Source file: LaunchingUtils.java

  22 
vote

/** 
 * Gets the output folder from the current configuration. Returns <code>null</code> if a valid folder cannot be calculated
 * @param configuration
 * @return
 */
public static IFolder getOutputFolder(ILaunchConfiguration configuration){
  String outputDirectory=null;
  try {
    outputDirectory=configuration.getAttribute(ILaunchingConstants.SRMC_OUTPUT_DIR,(String)null);
  }
 catch (  CoreException e) {
    return null;
  }
  if (outputDirectory == null)   return null;
  Path path=new Path(outputDirectory);
  IContainer container=ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
  if (container == null || container.getType() != IContainer.FOLDER)   return null;
  return (IFolder)container;
}
 

Example 2

From project bundlemaker, under directory /main/org.bundlemaker.core.ui/src/org/bundlemaker/core/ui/handler/.

Source file: CreateNewGroupHandler.java

  22 
vote

@Override protected IBundleMakerArtifact createArtifact(Shell shell,IGroupAndModuleContainer groupAndModuleContainer){
  String preset=getUniqueArtifactName(groupAndModuleContainer,"GROUP",null);
  String newGroupName=getGroupName(shell,groupAndModuleContainer,preset,true);
  if (newGroupName == null) {
    return null;
  }
  Path newGroupPath=new Path(newGroupName);
  IGroupArtifact newArtifact=groupAndModuleContainer.getOrCreateGroup(newGroupPath);
  return newArtifact;
}
 

Example 3

From project dawn-isenciaui, under directory /com.teaminabox.eclipse.wiki/src/com/teaminabox/eclipse/wiki/editors/.

Source file: WikiDocumentContext.java

  22 
vote

IFile getWikiFile(String word){
  IContainer container=getWorkingLocation();
  String wikiFileName=word + WikiConstants.WIKI_FILE_EXTENSION;
  Path path=new Path(wikiFileName);
  return container.getFile(path);
}
 

Example 4

From project droolsjbpm-tools, under directory /drools-eclipse/org.jbpm.eclipse/src/main/java/org/jbpm/eclipse/util/.

Source file: JBPMClasspathContainer.java

  22 
vote

private IClasspathEntry[] createJBPMLibraryEntries(IJavaProject project){
  String[] jarNames=getJarNames(project);
  List<IClasspathEntry> list=new ArrayList<IClasspathEntry>();
  if (jarNames != null) {
    for (int i=0; i < jarNames.length; i++) {
      Path path=new Path(jarNames[i]);
      list.add(JavaCore.newLibraryEntry(path,path,null));
    }
  }
  return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
}
 

Example 5

From project eclim, under directory /org.eclim.cdt/java/org/eclim/plugin/cdt/command/project/.

Source file: IncludeEntryCommand.java

  22 
vote

/** 
 * {@inheritDoc}
 * @see AbstractSettingEntryCommand#createEntry(CommandLine)
 */
@Override protected ICLanguageSettingEntry createEntry(CommandLine commandLine) throws Exception {
  String dir=commandLine.getValue(Options.DIR_OPTION);
  dir=FileUtils.removeTrailingSlash(dir);
  Path path=new Path(dir);
  if (path.isAbsolute()) {
    return new CIncludePathEntry(path,ICSettingEntry.LOCAL);
  }
  return new CIncludePathEntry(path,ICSettingEntry.VALUE_WORKSPACE_PATH);
}
 

Example 6

From project acceleo-modules, under directory /psm-gen-scala/plugins/com.github.sbegaudeau.acceleo.modules.psm.gen.scala.editor/src-gen/com/github/sbegaudeau/acceleo/modules/psm/gen/scala/model/scala/presentation/.

Source file: ScalaModelWizard.java

  21 
vote

/** 
 * The framework calls this to see if the file is correct. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override protected boolean validatePage(){
  if (super.validatePage()) {
    String extension=new Path(getFileName()).getFileExtension();
    if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
      String key=FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
      setErrorMessage(ScalaEditorPlugin.INSTANCE.getString(key,new Object[]{FORMATTED_FILE_EXTENSIONS}));
      return false;
    }
    return true;
  }
  return false;
}
 

Example 7

From project acceleo-webapp-generator, under directory /plugins/org.eclipse.acceleo.tutorial.webapp.editor/src-gen/org/eclipse/acceleo/tutorial/webapp/presentation/.

Source file: WebappModelWizard.java

  21 
vote

/** 
 * The framework calls this to see if the file is correct. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override protected boolean validatePage(){
  if (super.validatePage()) {
    String extension=new Path(getFileName()).getFileExtension();
    if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
      String key=FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
      setErrorMessage(WebappEditorPlugin.INSTANCE.getString(key,new Object[]{FORMATTED_FILE_EXTENSIONS}));
      return false;
    }
    return true;
  }
  return false;
}
 

Example 8

From project adt-cdt, under directory /com.android.ide.eclipse.adt.cdt/src/com/android/ide/eclipse/adt/cdt/internal/build/.

Source file: NDKCommandLauncher.java

  21 
vote

@Override public Process execute(IPath commandPath,String[] args,String[] env,IPath changeToDirectory,IProgressMonitor monitor) throws CoreException {
  if (Platform.getOS().equals(Platform.OS_WIN32) || Platform.getOS().equals(Platform.OS_MACOSX)) {
    String command=commandPath.toString();
    for (    String arg : args)     command+=" " + arg;
    commandPath=new Path("sh");
    args=new String[]{"-c",command};
  }
  return super.execute(commandPath,args,env,changeToDirectory,monitor);
}
 

Example 9

From project Archimedes, under directory /br.org.archimedes.core.tests/test/br/org/archimedes/.

Source file: FileLoader.java

  21 
vote

/** 
 * To be used when loading files so that they can be found both as plugin tests and normal unit tests.
 * @param filePath The filePath to the file to be loaded
 * @return An input stream for that file
 * @throws FileNotFoundException Thrown if the file cannot be found directly under that path.
 */
public static InputStream getReaderForFile(String filePath) throws FileNotFoundException {
  InputStream fileInput;
  try {
    Bundle bundle=Platform.getBundle(TESTS_PLUGIN_ID);
    IPath file=new Path(filePath);
    fileInput=FileLocator.openStream(bundle,file,false);
  }
 catch (  Throwable t) {
    fileInput=new FileInputStream("resources/" + filePath);
  }
  return fileInput;
}
 

Example 10

From project aws-toolkit-for-eclipse, under directory /com.amazonaws.eclipse.elasticbeanstalk/src/com/amazonaws/eclipse/elasticbeanstalk/webproject/.

Source file: CreateNewAwsJavaWebProjectRunnable.java

  21 
vote

private void addTemplateFiles(IProject project) throws IOException, CoreException {
  Bundle bundle=ElasticBeanstalkPlugin.getDefault().getBundle();
  URL url=FileLocator.resolve(bundle.getEntry("/"));
  IPath templateRoot=new Path(url.getFile(),"templates");
  if (dataModel.isSampleAppIncluded()) {
    for (    File file : templateRoot.append("TravelLog").toFile().listFiles(new ZipFileFilter())) {
      unzipSampleAppTemplate(file,project.getLocation().toFile());
    }
  }
 else {
    FileUtils.copyDirectory(templateRoot.append("basic").toFile(),project.getLocation().toFile(),new SvnMetadataFilter());
  }
  project.refreshLocal(IResource.DEPTH_INFINITE,null);
}
 

Example 11

From project bioclipse.seneca, under directory /plugins/net.bioclipse.seneca/src/net/bioclipse/seneca/domain/.

Source file: SenecaJobSpecification.java

  21 
vote

public Map<String,IPath> getJudgesData(){
  Nodes result=root.query("./sjs:judge",context);
  Map<String,IPath> judgesData=new HashMap<String,IPath>();
  for (int i=0; i < result.size(); i++) {
    if (((Element)result.get(i)).getAttribute("data") != null) {
      judgesData.put(((Element)result.get(i)).getAttribute("id").getValue(),new Path(((Element)result.get(i)).getAttribute("data").getValue()));
    }
  }
  return judgesData;
}
 

Example 12

From project bioclipse.speclipse, under directory /plugins/net.bioclipse.nmrshiftdb/src/net/bioclipse/nmrshiftdb/util/.

Source file: NmrshiftdbUtils.java

  21 
vote

public static IFolder createVirtualFolder() throws CoreException {
  final IProject root=net.bioclipse.core.Activator.getVirtualProject();
  int counter=1;
  String folderName=NMRSHIFTDB_FOLDER_NAME + " " + counter;
  while (root.exists(new Path(folderName))) {
    counter++;
    folderName=NMRSHIFTDB_FOLDER_NAME + " " + counter;
  }
  root.getFolder(folderName).create(true,true,new NullProgressMonitor());
  return root.getFolder(folderName);
}
 

Example 13

From project bndtools, under directory /bndtools.core/src/bndtools/.

Source file: Central.java

  21 
vote

public static IPath toPath(File file) throws Exception {
  String path=file.getCanonicalPath();
  String workspacePath=getWorkspace().getBase().getAbsolutePath();
  if (path.startsWith(workspacePath))   path=path.substring(workspacePath.length());
 else   return null;
  IPath p=new Path(path);
  return p;
}
 

Example 14

From project ccw, under directory /ccw.core/src/java/ccw/launching/.

Source file: LaunchUtils.java

  21 
vote

static public List<IFile> getFilesToLaunchList(ILaunchConfiguration config) throws CoreException {
  List<IFile> selectedFiles=new ArrayList<IFile>();
  for (  String path : config.getAttribute(LaunchUtils.ATTR_FILES_LAUNCHED_AT_STARTUP,"").split("\n")) {
    IResource rc=ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
    if (rc instanceof IFile) {
      selectedFiles.add((IFile)rc);
    }
  }
  return selectedFiles;
}
 

Example 15

From project ceylon-ide-eclipse, under directory /plugins/com.redhat.ceylon.eclipse.ui/src/com/redhat/ceylon/eclipse/code/hover/.

Source file: DocHover.java

  21 
vote

public static URL fileUrl(String icon){
  try {
    return FileLocator.toFileURL(FileLocator.find(CeylonPlugin.getInstance().getBundle(),new Path("icons/").append(icon),null));
  }
 catch (  IOException e) {
    e.printStackTrace();
    return null;
  }
}
 

Example 16

From project cilia-workbench, under directory /cilia-workbench-common/src/fr/liglab/adele/cilia/workbench/common/ui/view/.

Source file: CiliaLabelProvider.java

  21 
vote

private static Image createImageFromPath(String imagePath){
  org.osgi.framework.Bundle bundle=Activator.getInstance().getBundle();
  URL url=FileLocator.find(bundle,new Path(imagePath),null);
  try {
    url=new URL("platform:/plugin/fr.liglab.adele.cilia.workbench.common/" + imagePath);
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
  ImageDescriptor imageDesc=ImageDescriptor.createFromURL(url);
  return imageDesc.createImage();
}
 

Example 17

From project Database-Designer, under directory /plugins/org.obeonetwork.dsl.database.editor/src/org/obeonetwork/dsl/database/presentation/.

Source file: DatabaseModelWizard.java

  21 
vote

/** 
 * The framework calls this to see if the file is correct. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override protected boolean validatePage(){
  if (super.validatePage()) {
    String extension=new Path(getFileName()).getFileExtension();
    if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
      String key=FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
      setErrorMessage(DatabaseEditorPlugin.INSTANCE.getString(key,new Object[]{FORMATTED_FILE_EXTENSIONS}));
      return false;
    }
    return true;
  }
  return false;
}
 

Example 18

From project dawn-ui, under directory /org.dawb.workbench.plotting/src/org/dawb/workbench/plotting/tools/reduction/.

Source file: DataReductionWizard.java

  21 
vote

IFile getPath(){
  if (path == null) {
    IFile source=getSource();
    final String strPath=source.getName().substring(0,source.getName().indexOf(".")) + "_" + getShortToolName()+ "_reduction.h5";
    this.path=source.getParent().getFile(new Path(strPath));
  }
  return path;
}
 

Example 19

From project dawn-workflow, under directory /org.dawb.passerelle.actors/src/org/dawb/passerelle/actors/edna/.

Source file: AbstractEdnaPlugin.java

  21 
vote

private IFolder getEdnaXmlFolder() throws Exception {
  final IContainer cont=getProject();
  final IFolder edna=cont.getFolder(new Path("edna-xml"));
  if (!edna.exists()) {
    try {
      edna.create(true,true,new NullProgressMonitor());
    }
 catch (    Exception ne) {
      logger.error("Did not create new folder " + edna.getName(),ne);
    }
  }
  return edna;
}
 

Example 20

From project Diver, under directory /ca.uvic.chisel.javasketch/src/ca/uvic/chisel/javasketch/.

Source file: SketchPlugin.java

  21 
vote

private void delete(File file){
  IPath storageLocation=getStateLocation();
  IPath filePath=new Path(file.getAbsolutePath());
  if (!storageLocation.isPrefixOf(filePath))   return;
  if (file.isDirectory()) {
    File[] children=file.listFiles();
    for (    File child : children) {
      delete(child);
    }
  }
  file.delete();
}
 

Example 21

From project dolphin, under directory /com.sysdeo.eclipse.tomcat/src/com/sysdeo/eclipse/tomcat/.

Source file: TomcatLauncherPlugin.java

  21 
vote

public IPath getTomcatIPath(){
  IPath tomcatPath=getTomcatClasspathVariable();
  if (tomcatPath == null) {
    return new Path(TomcatLauncherPlugin.getDefault().getTomcatDir());
  }
 else {
    return new Path(TOMCAT_HOME_CLASSPATH_VARIABLE);
  }
}
 

Example 22

From project ds-annotation-builder, under directory /com.wuetherich.osgi.ds.annotations/src/com/wuetherich/osgi/ds/annotations/internal/builder/store/.

Source file: GeneratedComponentDescriptionsStore.java

  21 
vote

/** 
 * <p> </p>
 * @return
 * @throws CoreException
 */
public static List<IPath> getGeneratedFiles(IProject project,IPath resource) throws CoreException {
  List<IPath> result=new LinkedList<IPath>();
  Properties properties=loadProperties(project);
  for (  Entry<Object,Object> entry : properties.entrySet()) {
    if (resource.toOSString().equals(entry.getValue())) {
      result.add(new Path((String)entry.getKey()));
    }
  }
  return result;
}
 

Example 23

From project bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/.

Source file: Activator.java

  20 
vote

/** 
 * Returns a  {@link IProject},  {@link IFolder}, or  {@link IFile}, depending on what the provided resource denotes with respect to the {@link Workspace workspace} {@link Workspace#getRoot() root}.
 * @param resource Non-null {@link String}
 * @return {@link IResource}; may be null
 * @see #denotesFile(String)
 * @see #denotesFolder(String)
 * @see #denotesProject(String)
 */
public IResource getResource(String resource){
  IWorkspaceRoot root=getWorkspace().getRoot();
  if (denotesProject(resource)) {
    String[] tokens=resource.split("/");
    if (tokens.length < 2)     return null;
    return root.getProject(tokens[1]);
  }
 else   if (denotesFolder(resource)) {
    resource=resource.substring(2);
    return root.getFolder(new Path(resource));
  }
 else   if (denotesFile(resource)) {
    resource=resource.substring(2);
    return root.getFile(new Path(resource));
  }
  return null;
}
 

Example 24

From project BPMN2-Editor-for-Eclipse, under directory /org.eclipse.bpmn2.modeler.core/src/org/eclipse/bpmn2/modeler/core/.

Source file: ModelHandlerLocator.java

  20 
vote

private static ModelHandler createNewModelHandler(URI path,final Bpmn2ResourceImpl resource){
  ModelHandler handler=new ModelHandler();
  map.put(path,handler);
  handler.resource=resource;
  URI uri=resource.getURI();
  try {
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    String platformString=uri.toPlatformString(true);
    if ((platformString == null || workspace.getRoot().getFile(new Path(platformString)).exists()) && !resource.isLoaded()) {
      handler.loadResource();
    }
  }
 catch (  IllegalStateException e) {
    if (!resource.isLoaded()) {
      handler.loadResource();
    }
  }
  handler.createDefinitionsIfMissing();
  return handler;
}
 

Example 25

From project CIShell, under directory /templates/org.cishell.templates.wizards/src/org/cishell/templates/wizards/.

Source file: BasicTemplate.java

  20 
vote

public IFolder generateJavaSourceFolder(IFolder sourceFolder,IProgressMonitor monitor) throws CoreException {
  Object packageValue=getValue(KEY_PACKAGE_NAME);
  String packageName;
  if (packageValue != null) {
    packageName=packageValue.toString();
  }
 else {
    packageName=null;
  }
  if (packageName == null) {
    packageName=model.getPluginBase().getId();
  }
  IPath path=new Path(packageName.replace('.',File.separatorChar));
  if (sourceFolder != null) {
    path=sourceFolder.getProjectRelativePath().append(path);
  }
  for (int ii=1; ii <= path.segmentCount(); ii++) {
    IPath subpath=path.uptoSegment(ii);
    IFolder subfolder=project.getFolder(subpath);
    if (subfolder.exists() == false) {
      subfolder.create(true,true,monitor);
    }
  }
  return project.getFolder(path);
}
 

Example 26

From project dawn-common, under directory /org.dawb.common.ui/src/org/dawb/common/ui/project/.

Source file: FolderLinkWizard.java

  20 
vote

@Override public boolean performFinish(){
  try {
    final IContainer container=page.getProjectContainer();
    final File external=page.getExternalFolder();
    final IFolder folder=container.getFolder(new Path(external.getName()));
    getContainer().run(true,true,new IRunnableWithProgress(){
      @Override public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        try {
          monitor.beginTask("Creating link to " + folder.getName(),10);
          folder.createLink(external.toURI(),IResource.DEPTH_ONE,monitor);
          container.refreshLocal(IResource.DEPTH_ONE,monitor);
        }
 catch (        ResourceException e) {
          MessageDialog.openError(getShell(),"Cannot Import Folder",e.getMessage());
          logger.error("Cannot create link folder " + folder.getName(),e);
        }
catch (        CoreException e) {
          logger.error("Cannot create link folder " + folder.getName(),e);
        }
 finally {
          monitor.done();
        }
      }
    }
);
  }
 catch (  Exception ne) {
    logger.error("Cannot create link",ne);
    return false;
  }
  return true;
}
 

Example 27

From project dawn-product, under directory /org.dawnsci.intro/src/org/dawnsci/intro/content/.

Source file: ASinglePerspectiveContentProvider.java

  20 
vote

@Override public void createContent(String id,Element parent){
  System.out.println("AsinglePerspective ID:" + id);
  System.out.println("parent:" + parent.getLocalName());
  Document dom=parent.getOwnerDocument();
  Element div=dom.createElement("div");
  div.setAttribute("class","grid_" + introActions.size());
  parent.appendChild(div);
  Iterator<IConfigurationElement> iter=introActions.iterator();
  while (iter.hasNext()) {
    try {
      IConfigurationElement config=iter.next();
      String name=config.getAttribute(ATT_NAME);
      String classname=config.getAttribute(ATT_CLASS);
      IContributor contrib=config.getContributor();
      String contribName=contrib instanceof RegistryContributor ? ((RegistryContributor)contrib).getActualName() : contrib.getName();
      URL bundleURL=FileLocator.find(Platform.getBundle(contribName),new Path(config.getAttribute(ATT_ICON)),null);
      URL imgURL=null;
      imgURL=FileLocator.toFileURL(bundleURL);
      Element a=dom.createElement("a");
      Element span=dom.createElement("span");
      Element img=dom.createElement("img");
      a.setAttribute("href","http://org.eclipse.ui.intro/runAction?pluginId=org.dawnsci.intro&;class=org.dawnsci.intro.actions.OpenPerspectiveAction&name=" + classname);
      a.setAttribute("class","portfolio_item float alpha");
      span.appendChild(dom.createTextNode(name));
      span.setTextContent("testtest");
      img.setAttribute("class","");
      img.setAttribute("src",imgURL.getPath());
      img.setAttribute("alt","");
      a.appendChild(span);
      a.appendChild(img);
      div.appendChild(a);
    }
 catch (    IOException e) {
      logger.error("TODO put description of error here",e);
    }
  }
}
 

Example 28

From project dozer, under directory /eclipse-plugin/net.sf.dozer.eclipse.plugin/src/org/dozer/eclipse/plugin/.

Source file: DozerPlugin.java

  20 
vote

private void registerImage(ImageRegistry registry,String key,String fileName,String overlayFileName){
  try {
    IPath path=new Path("icons/" + fileName);
    URL url=find(path);
    if (url != null) {
      ImageDescriptor desc=ImageDescriptor.createFromURL(url);
      if (overlayFileName != null) {
        path=new Path("icons/" + overlayFileName);
        url=find(path);
        ImageDescriptor descOverlay=ImageDescriptor.createFromURL(url);
        Image overlayImg=createOverlayImg(desc.createImage(),descOverlay.createImage());
        desc=ImageDescriptor.createFromImage(overlayImg);
      }
      registry.put(key,desc);
    }
  }
 catch (  Exception e) {
  }
}
 

Example 29

From project e4-rendering, under directory /com.toedter.e4.demo.contacts.generic/src/com/toedter/e4/demo/contacts/generic/.

Source file: BundleActivatorImpl.java

  20 
vote

public IPath getStateLocation(){
  try {
    if (stateLocation == null) {
      Filter filter=context.createFilter(Location.INSTANCE_FILTER);
      if (locationServiceTracker == null) {
        locationServiceTracker=new ServiceTracker(context,filter,null);
        locationServiceTracker.open();
      }
      Location location=(Location)locationServiceTracker.getService();
      if (location != null) {
        IPath path=new Path(location.getURL().getPath());
        stateLocation=path.append(F_META_AREA).append(F_PLUGIN_DATA).append(context.getBundle().getSymbolicName());
        stateLocation.toFile().mkdirs();
      }
    }
  }
 catch (  InvalidSyntaxException e) {
  }
  return stateLocation;
}
 

Example 30

From project CBCJVM, under directory /eclipse/src/cbclipse/builder/.

Source file: CBCNature.java

  19 
vote

public void configure() throws CoreException {
  IProjectDescription desc=project.getDescription();
  ICommand[] commands=desc.getBuildSpec();
  for (int i=0; i < commands.length; ++i) {
    if (commands[i].getBuilderName().equals(CBCBuilder.BUILDER_ID)) {
      return;
    }
  }
  ICommand[] newCommands=new ICommand[commands.length + 1];
  System.arraycopy(commands,0,newCommands,0,commands.length);
  ICommand command=desc.newCommand();
  command.setBuilderName(CBCBuilder.BUILDER_ID);
  newCommands[newCommands.length - 1]=command;
  desc.setBuildSpec(newCommands);
  project.setDescription(desc,null);
  IJavaProject javaProject=JavaCore.create(project);
  Set<IClasspathEntry> entries=new HashSet<IClasspathEntry>();
  entries.addAll(Arrays.asList(javaProject.getRawClasspath()));
  String osPath=Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_PATH);
  IPath path=Path.fromOSString(osPath);
  LibraryLocation location=new LibraryLocation(path,Path.EMPTY,Path.EMPTY);
  entries.add(JavaCore.newLibraryEntry(location.getSystemLibraryPath(),null,null));
  javaProject.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]),new NullProgressMonitor());
  IFile commCBC=project.getFile("comm.cbc");
  commCBC.create(new ByteArrayInputStream(new byte[]{}),true,new NullProgressMonitor());
}