Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path


  }

  public IFile getWGAConfigFile() {
    if (getWGABase() != null) {
      return getWGABase().getFile(new Path("wgaconfig.xml"));
    } else {
      return null;
    }
  }
View Full Code Here


  public InputStream getContents() throws CoreException {
    return new ByteArrayInputStream(_content);
  }

  public IPath getFullPath() {
    return new Path(_state.getPath());
  }
View Full Code Here

    } else {
      if (_localState != null && _localState.isDirLink()) {
        String linkName = _localState.getDirLinkName();
        IContainer linkTarget = _localState.getDirLinkTarget();
        int matchingSegments = linkTarget.getFullPath().matchingFirstSegments(getLocal().getFullPath());     
        return new Path(linkName).append(getLocal().getFullPath().removeFirstSegments(matchingSegments)).makeRelative().toString();       
      } else if (getRemote() != null) {
        FSDesignResourceState remoteState = ((WGAFSDesignResourceVariant)getRemote()).getState();
        if (remoteState != null) {
          return remoteState.getPath();
        }
View Full Code Here

    public void apply(IDocument document) {
      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        IFolder tmlFolder = new WGADesignStructureHelper(referer).getTmlRoot();
        IFile fileToCreate = tmlFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
View Full Code Here

      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
        IFolder scriptFolder = helper.getScriptsRoot();
        IFile fileToCreate = scriptFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
View Full Code Here

  public static IFolder createFolder(IContainer container, String name) throws CoreException {
    return createFolder(container, name, null);
  }
 
  public static IFolder createFolder(IContainer container, String name, IProgressMonitor monitor) throws CoreException {
    IFolder folder = container.getFolder(new Path(name));
    if (!folder.exists()) {
      folder.create(false, true, monitor);       
    }
    return folder;
  }
View Full Code Here

        }
      }
    }
 
  public static final IPath makeRelative(IPath source, IPath context){
    IPath result = new Path("");
    int mfs = source.matchingFirstSegments(context);
    source = source.removeFirstSegments(mfs);
    context = context.removeFirstSegments(mfs);
   
    for(int i=0;i < source.segmentCount();i++){
      result=result.append("../");
    }
    result=result.append(context);   
   
    return result;
  }
View Full Code Here

    }
 
 
    private InputStream getResourceAsStream(String relativePath) throws IOException {
        if (relativePath.startsWith("resources/")) {
            return FileLocator.toFileURL(FileLocator.find(Platform.getBundle(PLUGIN_ID), new Path(relativePath), null)).openStream();
        } else {
            return new FileInputStream(relativePath);
        }
    }
View Full Code Here

      return null;
    }

    if (file.getName().equals(DesignDirectory.DESIGN_DEFINITION_FILE)) {
      return file;
    } else if (file.getName().equals(DesignDirectory.SYNCINFO_FILE) && !file.getParent().getFile(new Path(DesignDirectory.DESIGN_DEFINITION_FILE)).exists()) {
      return file;
    }
    IContainer parent = file.getParent();
    return determineSyncInfo(parent);
  }
View Full Code Here

   * @return true/false
   */

 
  public static boolean isDirlinkFolder(IFolder container){
    IFile dirlink = container.getFile(new Path(WGUtils.DIRLINK_FILE))
    return dirlink.exists();
  }
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.