Package aQute.bnd.service

Examples of aQute.bnd.service.ResourceHandle


    private File getFile() {
        try {
            File file;
            if (repo instanceof RemoteRepositoryPlugin) {
                ResourceHandle handle = ((RemoteRepositoryPlugin) repo).getHandle(bsn, "latest", Strategy.HIGHEST, null);
                if (handle.getLocation() == Location.local || handle.getLocation() == Location.remote_cached)
                    file = handle.request();
                else
                    file = null;
            } else {
                SortedSet<Version> versions = repo.versions(bsn);
                if (versions == null || versions.isEmpty())
View Full Code Here


  public synchronized void setReporter(Reporter reporter) {
    this.reporter = reporter;
  }
 
  public File get(String bsn, String range, Strategy strategy, Map<String, String> properties) throws Exception {
    ResourceHandle handle = getHandle(bsn, range, strategy, properties);
    return handle != null ? handle.request() : null;
  }
View Full Code Here

    ResourceHandle handle = getHandle(bsn, range, strategy, properties);
    return handle != null ? handle.request() : null;
  }
 
  public ResourceHandle getHandle(String bsn, String range, Strategy strategy, Map<String, String> properties) throws Exception {
    ResourceHandle result;
    if (bsn != null)
      result = resolveBundle(bsn, range, strategy);
    else {
      String pkgName = properties.get(CapabilityType.PACKAGE.getTypeName());
     
View Full Code Here

 
  List<ResourceHandle> mapResourcesToHandles(Collection<Resource> resources) throws Exception {
    List<ResourceHandle> result = new ArrayList<ResourceHandle>(resources.size());
   
    for (Resource resource : resources) {
      ResourceHandle handle = mapResourceToHandle(resource);
      if (handle != null)
        result.add(handle);
    }
   
    return result;
View Full Code Here

   
    return result;
  }
 
  ResourceHandle mapResourceToHandle(Resource resource) throws Exception {
    ResourceHandle result = null;
   
    CachingURLResourceHandle handle ;
    try {
      handle = new CachingURLResourceHandle(resource.getUrl(), resource.getBaseUrl(), getCacheDirectory(), getConnector(), CachingMode.PreferCache);
    } catch (FileNotFoundException e) {
View Full Code Here

    if (strategy == Strategy.EXACT) {
      return findExactMatch(bsn, rangeStr, bsnMap);
    }
   
    ResourceHandle[] handles = getHandles(bsn, rangeStr);
    ResourceHandle selected;
    if (handles == null || handles.length == 0)
      selected = null;
    else {
      switch(strategy) {
      case LOWEST:
View Full Code Here

TOP

Related Classes of aQute.bnd.service.ResourceHandle

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.