Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IContainer.findMember()


  // is atually the package fragment root)
  if (rootResource.getType() == IResource.FOLDER || rootResource.getType() == IResource.PROJECT) {
    IContainer folder = (IContainer) rootResource;
    String[] segs = this.names;
    for (int i = 0; i < segs.length; ++i) {
      IResource child = folder.findMember(segs[i]);
      if (child == null || child.getType() != IResource.FOLDER) {
        throw newNotPresentException();
      }
      folder = (IFolder) child;
    }
View Full Code Here


    char[][] exclusionPatterns = root.fullExclusionPatternChars();
    int i;
    for (i = 0; i < this.pkgName.length; i++) {
      String subFolderName = this.pkgName[i];
      sideEffectPackageName = Util.arrayConcat(sideEffectPackageName, subFolderName);
      IResource subFolder = parentFolder.findMember(subFolderName);
      if (subFolder == null) {
        createFolder(parentFolder, subFolderName, force);
        parentFolder = parentFolder.getFolder(new Path(subFolderName));
        IPackageFragment addedFrag = root.getPackageFragment(sideEffectPackageName);
        if (!Util.isExcluded(parentFolder, inclusionPatterns, exclusionPatterns)) {
View Full Code Here

    return new JavaModelStatus(IJavaModelStatusConstants.READ_ONLY, root);
  }
  IContainer parentFolder = (IContainer) root.getResource();
  int i;
  for (i = 0; i < this.pkgName.length; i++) {
    IResource subFolder = parentFolder.findMember(this.pkgName[i]);
    if (subFolder != null) {
      if (subFolder.getType() != IResource.FOLDER) {
        return new JavaModelStatus(
          IJavaModelStatusConstants.NAME_COLLISION,
          Messages.bind(Messages.status_nameCollision, subFolder.getFullPath().toString()));
View Full Code Here

        try {
            for (int i = 0; i < fileLocation.segmentCount() - 1; i++) {

                String currentSegment = fileLocation.segment(i);
                IResource container = current.findMember(currentSegment);

                if (container != null) {
                    if (container.getType() != IContainer.FOLDER) {
                        throw new IllegalArgumentException("Resource " + container
                                + " exists and is not a folder; unable to create file at path " + fileLocation);
View Full Code Here

                        @Override
                        public void run(IProgressMonitor monitor)
                                throws InvocationTargetException,
                                InterruptedException {
                            try {
                                IResource jcrRoot = container
                                        .findMember("jcr_root");
                                if (jcrRoot == null
                                        || !(jcrRoot instanceof IFolder)) {
                                    MessageDialog.openError(getDisplay()
                                            .getActiveShell(),
View Full Code Here

    final IContainer container = folder.getParent();
    if (container==null || !container.exists()) {
      return false;
    }
    if (resourceName.endsWith(".dir")) {
      final IResource peerNode = container.findMember(decodedName);
      if (peerNode==null || !peerNode.exists()) {
        return false;
      }
    }
    // then it is likely the pattern that corresponds to the case
View Full Code Here

  // is atually the package fragment root)
  if (rootResource.getType() == IResource.FOLDER || rootResource.getType() == IResource.PROJECT) {
    IContainer folder = (IContainer) rootResource;
    String[] segs = this.names;
    for (int i = 0; i < segs.length; ++i) {
      IResource child = folder.findMember(segs[i]);
      if (child == null || child.getType() != IResource.FOLDER) {
        throw newNotPresentException();
      }
      folder = (IFolder) child;
    }
View Full Code Here

      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IContainer container = root.getContainerForLocation(new Path(file.getParent()));

      if (container != null) {
        IResource resource = container.findMember(file.getName());

        if (resource instanceof IFile) {
          return resource;
        }
      } else {
View Full Code Here

  }

  static IFile getIFileResource(IProject project, String folderName,
      String fileName) throws FileNotFoundException {
    IContainer webRoot = GaeBridge.getWebFolder(project);
    IResource fm = webRoot.findMember(folderName);
    IFolder fm2 = (IFolder) fm;
    IFile file = fm2.getFile(fileName);// "web.xml"
    return file;
  }
View Full Code Here

      String entryPath, boolean addToBuildPath) throws CoreException, FileNotFoundException {
    Enumeration<?> entryPaths = bundle.getEntryPaths(entryPath);
    IContainer webFolder = GaeBridge.getWebFolder(fCurrJProject
        .getProject());
   
    IFolder folder = ((IFolder) webFolder.findMember("WEB-INF"))
        .getFolder("lib");
    while (entryPaths != null && entryPaths.hasMoreElements()) {
      String path = (String) entryPaths.nextElement();
      if (path.endsWith("/.svn/")) {
        continue;
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.