Package org.eclipse.core.runtime

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


                   
                    String path = resource.getFullPath().makeRelativeTo( root.getFullPath() ).toString();
                   
                    if( path.startsWith( "/" ) && path.length() > 1 )
                    {
                        path = path.substring( 1 );
                    }
                   
                    textField.setText( path );
                }
            }
View Full Code Here


        final InputStream is = new FileInputStream(path);

        final String fileName;
        if (path.contains("/")) {
          fileName = path.substring(path.lastIndexOf("/") + 1);
        } else {
          fileName = path.substring(path.lastIndexOf("\\") + 1);
        }

        IFile importFile = importProject.getFile(fileName);
View Full Code Here

        final String fileName;
        if (path.contains("/")) {
          fileName = path.substring(path.lastIndexOf("/") + 1);
        } else {
          fileName = path.substring(path.lastIndexOf("\\") + 1);
        }

        IFile importFile = importProject.getFile(fileName);
        if (importFile.exists()) {
          importFile.delete(true, null);
View Full Code Here

    else if (resource instanceof UrlResource) {
      URL url = resource.getURL();
      String path = url.getPath();
      int ix = path.indexOf('!');
      if (ix > 0) {
        String entryName = path.substring(ix + 1);
        path = path.substring(0, ix);

        try {
          return new ExternalFile(new File(new URI(path)), entryName, project);
        }
View Full Code Here

      URL url = resource.getURL();
      String path = url.getPath();
      int ix = path.indexOf('!');
      if (ix > 0) {
        String entryName = path.substring(ix + 1);
        path = path.substring(0, ix);

        try {
          return new ExternalFile(new File(new URI(path)), entryName, project);
        }
        catch (URISyntaxException e) {
View Full Code Here

      String path = ((ClassPathResource) resource).getPath();
      String fileName = path;
      String packageName = "";
      int ix = path.lastIndexOf('/');
      if (ix > 0) {
        fileName = path.substring(ix + 1);
        packageName = path.substring(0, ix).replace('/', '.');
      }
      if (fileName.endsWith(ClassUtils.CLASS_FILE_SUFFIX)) {
        String typeName = packageName + "." + fileName.substring(0, fileName.length() - 6);
        for (IPackageFragmentRoot root : roots) {
View Full Code Here

      String fileName = path;
      String packageName = "";
      int ix = path.lastIndexOf('/');
      if (ix > 0) {
        fileName = path.substring(ix + 1);
        packageName = path.substring(0, ix).replace('/', '.');
      }
      if (fileName.endsWith(ClassUtils.CLASS_FILE_SUFFIX)) {
        String typeName = packageName + "." + fileName.substring(0, fileName.length() - 6);
        for (IPackageFragmentRoot root : roots) {
          Resource storage = null;
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.