Package org.eclipse.wst.common.componentcore.resources

Examples of org.eclipse.wst.common.componentcore.resources.IVirtualReference


      //Not a workspace file, we assume it's an external reference
      File underlyingFile = (File)flatFile.getAdapter(File.class);
      if (underlyingFile != null && underlyingFile.exists()) {
        filePath = flatFile.getModuleRelativePath().toPortableString() + Path.SEPARATOR + underlyingFile.getName();
        if (filter == null || filter.accepts(filePath, true)) {
          IVirtualReference reference = createReference(underlyingFile, flatFile.getModuleRelativePath());
          references.add(reference);
        }
      }
    } else {
      final String fileName = f.getName();    
View Full Code Here


    return null;
  }
 
  private IVirtualReference createReference(File underlyingFile, IPath path) {
    VirtualArchiveComponent archive = new VirtualArchiveComponent(project, VirtualArchiveComponent.LIBARCHIVETYPE + Path.SEPARATOR + underlyingFile.getAbsolutePath(), path);
    IVirtualReference ref = ComponentCore.createReference(flatVirtualComponent.getComponent(), archive);
    ref.setArchiveName(archive.getArchivePath().lastSegment());
    ref.setRuntimePath(path);
    return ref;
  }
View Full Code Here

        if (overlayComponent != null) {
         
          overlayComponent.setInclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getIncludes())));
          overlayComponent.setExclusions(new LinkedHashSet<String>(Arrays.asList(overlay.getExcludes())));
         
          IVirtualReference depRef = ComponentCore.createReference(warComponent, overlayComponent);
          String targetPath = StringUtils.nullOrEmpty(overlay.getTargetPath())?"/":overlay.getTargetPath(); //$NON-NLS-1$
          depRef.setRuntimePath(new Path(targetPath));
          newOverlayRefs.add(depRef);
        }
      }
     
    }
View Full Code Here

        //artifact dependency should be added as a JEE module, referenced with M2_REPO variable
        depComponent = createDependencyComponent(earComponent, earModule.getArtifact());
      }
     
      if (depComponent != null && packagingConfig.isPackaged(earModule.getUri())) {
        IVirtualReference depRef = ComponentCore.createReference(earComponent, depComponent);
        String bundleDir = (StringUtils.isBlank(earModule.getBundleDir()))?"/":earModule.getBundleDir(); //$NON-NLS-1$
        depRef.setRuntimePath(new Path(bundleDir));
        depRef.setArchiveName(earModule.getBundleFileName());
        newRefs.add(depRef);
      }
    }
   
    IVirtualReference[] newRefsArray = new IVirtualReference[newRefs.size()];
View Full Code Here

  }
 
  comp.setInclusions(getPatternSet(parameters.get(INCLUDES)));
  comp.setExclusions(getPatternSet(parameters.get(EXCLUDES)));

  IVirtualReference ref = ComponentCore.createReference(component, comp);
    ref.setArchiveName(referencedComponent.getArchiveName());
    ref.setRuntimePath(referencedComponent.getRuntimePath());
    ref.setDependencyType(referencedComponent.getDependencyType().getValue());
    return ref;
  }
View Full Code Here

      }
      String deployedName = deployedArtifacts.get(artifact);
     
      //an artifact in mavenProject.getArtifacts() doesn't have the "optional" value as depMavenProject.getArtifact(); 
      if (deployedName != null) {
        IVirtualReference reference = ComponentCore.createReference(component, depComponent);
        IPath path = new Path("/WEB-INF/lib"); //$NON-NLS-1$
        reference.setArchiveName(deployedName);
        reference.setRuntimePath(path);
        references.add(reference);
      }
    }

    IVirtualReference[] oldRefs = WTPProjectsUtil.extractHardReferences(component, false);
View Full Code Here

    }
    if (existingRefs == null || existingRefs.length != refArray.length) {
      return true;
    }
    for (int i=0; i<existingRefs.length;i++){
      IVirtualReference existingRef = existingRefs[i];
      IVirtualReference newRef = refArray[i];
      if ((existingRef.getArchiveName() != null && !existingRef.getArchiveName().equals(newRef.getArchiveName())) ||
          (existingRef.getArchiveName() == null && newRef.getArchiveName() != null) ||
          !existingRef.getReferencedComponent().equals(newRef.getReferencedComponent()) ||
          !existingRef.getRuntimePath().equals(newRef.getRuntimePath()))
      {
        return true
      }
    }
    return false;   
View Full Code Here

    }
    if (existingRefs == null || existingRefs.length != refArray.length) {
      return true;
    }
    for (int i=0; i<existingRefs.length;i++){
      IVirtualReference existingRef = existingRefs[i];
      IVirtualReference newRef = refArray[i];
      if (
          !existingRef.getReferencedComponent().equals(newRef.getReferencedComponent()) ||
          !existingRef.getRuntimePath().equals(newRef.getRuntimePath()))
      {
        return true
      }
    }
    return false;   
View Full Code Here

    }
  }

  private IVirtualReference createReference(IVirtualComponent rarComponent, IProject project, Artifact artifact) {
    IVirtualComponent depComponent = ComponentCore.createComponent(project);
    IVirtualReference depRef = ComponentCore.createReference(rarComponent, depComponent);
    String deployedFileName = FileNameMappingFactory.getDefaultFileNameMapping().mapFileName(artifact);
    depRef.setArchiveName(deployedFileName);
    return depRef;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.common.componentcore.resources.IVirtualReference

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.