public void customResultAvailable(List<IResourceIdentifier> result) { final List<URL> res = new ArrayList<URL>(); for(int i=0; i<result.size(); i++) { res.add(result.get(i).getLocalIdentifier().getUrl()); } res.addAll(getInternalNonManagedURLs()); ret.setResult(res); } });
public void customResultAvailable(List<IResourceIdentifier> result) { final List<URL> res = new ArrayList<URL>(); for(int i=0; i<result.size(); i++) { if(!rootrid.equals(result.get(i))) { res.add(result.get(i).getLocalIdentifier().getUrl()); } } Set<URI> re = getInternalNonManagedURLs(); for(URI uri: re) { URL url = SUtil.toURL0(uri); if(url!=null) res.add(url); } // res.addAll(); // System.out.println("getAllUrls: "+(System.currentTimeMillis()-start)); ret.setResult(res); } });
/** * Create a new classloader. */ public DelegationURLClassLoader(IResourceIdentifier rid, ClassLoader basecl, DelegationURLClassLoader[] delegates) { super(rid!=null && rid.getLocalIdentifier()!=null? new URL[]{rid.getLocalIdentifier().getUrl()}: new URL[0], // No parent class loader to avoid multiple lookups of unavailable classes (not supported on android) SReflect.isAndroid() ? basecl : null); this.rid = rid; this.basecl = basecl; this.delegates = delegates==null? new ArrayList(): SUtil.arrayToList(delegates); this.parents = new ArrayList<DelegationURLClassLoader>(); // addParentClassLoader(parent); // System.out.println("d1 : "+rid+" "+SUtil.arrayToString(delegates)); }
/** * Create a new classloader. */ public DelegationURLClassLoader(IResourceIdentifier rid, ClassLoader basecl, DelegationURLClassLoader[] delegates) { super(rid!=null && rid.getLocalIdentifier()!=null? new URL[]{rid.getLocalIdentifier().getUrl()}: new URL[0], // No parent class loader to avoid multiple lookups of unavailable classes (not supported on android) SReflect.isAndroid() ? basecl : null); this.rid = rid; this.basecl = basecl; this.delegates = delegates.clone(); // System.out.println("d1 : "+rid+" "+SUtil.arrayToString(delegates)); }
URL url = rid.getLocalIdentifier().getUrl(); File f = new File(url.getFile()); if(url.getFile().endsWith(".jar") && f.exists())
boolean nhasch = n.getChildCount()>0 || (issyscp && ((IResourceIdentifier)n.getMyUserObject()).getLocalIdentifier().getUrl().toString().indexOf(".jar")==-1); for(int i=0; i<cnt && !inserted; i++) boolean tmphasch = tmp.getChildCount()>0 || (issyscp && ((IResourceIdentifier)tmp.getMyUserObject()).getLocalIdentifier().getUrl().toString().indexOf(".jar")==-1); if((!tmphasch && nhasch) || (tmphasch==nhasch && n.toString().compareTo(tmp.toString())<0 ))
ret = lrid.getUrl().toString();
/** * Test if equals. */ public boolean equals(Object obj) { boolean ret = false; if(obj instanceof ILocalResourceIdentifier) { ILocalResourceIdentifier other = (ILocalResourceIdentifier)obj; // ret = SUtil.equals(getComponentIdentifier(), other.getComponentIdentifier()) // && SUtil.equals(getUrl(), other.getUrl()); ret = SUtil.equals(getHostIdentifier(), other.getHostIdentifier()) && SUtil.equals(getUrl(), other.getUrl()); } return ret; }
rid.setLocalIdentifier(new LocalResourceIdentifier(cid, lid.getUrl()));
assert rid.getLocalIdentifier()==null || !isLocal(rid) || !getInternalNonManagedURLs().contains(rid.getLocalIdentifier().getUrl());
addTopLevelURL(b.getLocalIdentifier().getUrl());
assert rid.getLocalIdentifier()==null || !isLocal(rid) || !getInternalNonManagedURLs().contains(SUtil.toURI0(rid.getLocalIdentifier().getUrl()));
else if(isLocal(rid) && getInternalNonManagedURLs().contains(rid.getLocalIdentifier().getUrl()))
if(isLocal(rid) && getInternalNonManagedURLs().contains(SUtil.toURI0(rid.getLocalIdentifier().getUrl())))
if(isLocal(rid) && getInternalNonManagedURLs().contains(rid.getLocalIdentifier().getUrl()))
if(checkUrl(rid.getLocalIdentifier().getUrl())==null)
String url = process.getModel().getResourceIdentifier().getLocalIdentifier().getUrl().toString();
else if(isLocal(rid) && getInternalNonManagedURLs().contains(SUtil.toURI0(rid.getLocalIdentifier().getUrl())))
/** * Create properties from rid. * @param The resource identifier. * @return rid The resource identifier properties. */ public Properties ridToProperties(IResourceIdentifier rid) { Properties ret = new Properties(); if(rid!=null && rid.getGlobalIdentifier()!=null) { ret.addProperty(new Property("gid_ri", rid.getGlobalIdentifier().getResourceId())); ret.addProperty(new Property("gid_vi", rid.getGlobalIdentifier().getVersionInfo())); // ret.addProperty(new Property("url", rid.getGlobalIdentifier().getRepositoryInfo())); } if(rid!=null && rid.getLocalIdentifier()!=null) { ret.addProperty(new Property("lid_url", SUtil.convertPathToRelative(rid.getLocalIdentifier().getUrl().toString()))); // todo: check if own platform cid? // ret.addProperty(new Property("lid_cid", rid.getLocalIdentifier().getComponentIdentifier())); } return ret; }