Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path.toFile()


    }

    public static IPath createGuvnorMetadataLocation(String rootPath) throws Exception {
        IPath path = new Path(rootPath + File.separator + ".guvnorinfo"); //$NON-NLS-1$
        if (!path.toFile().exists()) {
            if (!path.toFile().mkdir()) {
                throw new Exception("Could not create directory " + path.toOSString()); //$NON-NLS-1$
            }
        }
        return path;
    }
View Full Code Here


            String pathName = FileLocator.getBundleFile(bundle).getPath();
            Path path = new Path(pathName);
            list.add(JavaCore.newLibraryEntry(
                  path, sourcePath(path), null, null, attributes(path), false));

            if (path.toFile().isDirectory()){
              listFiles(path.toFile(), new FileFilter(){
                public boolean accept(File file) {
                  if (file.getName().endsWith(".jar")){
                    list.add(JavaCore.newLibraryEntry(
                          new Path(file.getPath()),
View Full Code Here

            Path path = new Path(pathName);
            list.add(JavaCore.newLibraryEntry(
                  path, sourcePath(path), null, null, attributes(path), false));

            if (path.toFile().isDirectory()){
              listFiles(path.toFile(), new FileFilter(){
                public boolean accept(File file) {
                  if (file.getName().endsWith(".jar")){
                    list.add(JavaCore.newLibraryEntry(
                          new Path(file.getPath()),
                          null, null, null, null, false));
View Full Code Here

            path.uptoSegment(path.segmentCount() - 1).toString() +
            File.separator + parts[0] + ".source_" + parts[1]) :
        null;
    }

    return sourcePath != null && sourcePath.toFile().exists() ? sourcePath : null;
  }

  private IClasspathAttribute[] attributes(Path path)
  {
    String name = null;
View Full Code Here

    shell.bot().textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(newPath.toOSString());
    shell.bot().checkBox(UIText.CreateRepositoryPage_BareCheckbox).select();
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    refreshAndWait();
    repoFile = newPath.toFile();
    myRepoViewUtil.getRootItem(getOrOpenView().bot().tree(), repoFile);
    assertTrue(myRepoViewUtil.lookupRepository(repoFile).isBare());
  }

  @Test
View Full Code Here

  }

  private IPath toLegalPharPath(String selectedFileName) {
    // TODO Auto-generated method stub
    IPath path = new Path(selectedFileName);
    if (path.segmentCount() > 0 && ensureTargetFileIsValid(path.toFile())
        && path.getFileExtension() == null) {
      if (pharCompressRadio.getSelection()) {
        if (!PharConstants.PHAR_EXTENSION.equals(path
            .getFileExtension())) {
          path = path.addFileExtension(PharConstants.PHAR_EXTENSION);
View Full Code Here

              || (fPHPIni.getText() == null || fPHPIni.getText()
                  .trim().length() == 0)) {
            IPath path = new Path(newPath);
            path = path.removeLastSegments(1);
            path = path.append(PHP_INI);
            if (path.toFile().exists()) {
              fPHPIni.setText(path.toOSString());
            }
          }
        }
        updateItem();
View Full Code Here

      Seperator = "/n";
  }

  // Validate the private lib path
  Path PrivateLibFolder = new Path(mArduinoPrivateLibPath.getStringValue());
  boolean isArduinoPrivateLibFolderValid = PrivateLibFolder.toFile().canRead();
  if (!isArduinoPrivateLibFolderValid) {
      ErrorMessage += Seperator + "Private library folder is not correct!";
      Seperator = "/n";
  }
View Full Code Here

  IPath boardFileName = new Path(Common.getBuildEnvironmentVariable(confDesc, ArduinoConst.ENV_KEY_JANTJE_BOARDS_FILE,
    ArduinoInstancePreferences.getLastUsedBoardsFile()));
  // TODO arduino specification makes it possible to have more than 1 platformfile lets for now assume there is only 1
  IPath platformFilename = new Path(Common.getBuildEnvironmentVariable(confDesc, ArduinoConst.ENV_KEY_JANTJE_PLATFORM_FILE, ""));
  if (!platformFilename.toFile().exists()) {
      // TODO lets for now hardcode this is arduino
      for (int cursegment = 0; cursegment < platformFilename.segmentCount(); cursegment++) {
    if (ARDUINO_HARDWARE_FOLDER_NAME.equals(platformFilename.segment(cursegment))) {

        platformFilename = getArduinoPath().append(ARDUINO_HARDWARE_FOLDER_NAME).append("arduino")
View Full Code Here

        if (saveLocation != null)
        {
            try
            {
                final Persister persister = new Persister(new Format(2));
                persister.write(attributes, saveLocation.toFile());
            }
            catch (Exception e)
            {
                Utils.showError(new Status(IStatus.ERROR, WorkbenchCorePlugin.PLUGIN_ID,
                    "An error occurred while saving attributes.", e));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.