Package net.sourceforge.javautil.common.classloader

Examples of net.sourceforge.javautil.common.classloader.ClassLoaderResource


   *
   * @param resource The resource to search for
   * @return A {@link IVirtualFile} implementation that will wrap the resource, or null if no such resource exists
   */
  public static IVirtualFile getResource (String resource) {
    ClassLoaderResource rsc = ClassLoaderScanner.getResource(resource);
    if (rsc == null && !resource.startsWith("/")) rsc = ClassLoaderScanner.getResource("META-INF/" + resource);
    return rsc == null ? null : rsc.getFile();
  }
View Full Code Here


* @version $Id$
*/
public class URLStreamHandlerFactoryComposite implements URLStreamHandlerFactory {
 
  public static void main(String[] args) {
    ClassLoaderResource rsc = ClassLoaderScanner.getClassResource(SUN_DETECT_CLASS);
    System.out.println(rsc);
  }
View Full Code Here

  @Override protected boolean refreshRoot() { return false; }

  @Override protected ClassSource resolve(String type, IClassPackageResolver resolver, IClassPackageReference reference) {
    if (!"main".equalsIgnoreCase(type)) return null;
    ClassLoaderResource rsc = this.getResource(reference);
    return rsc == null ? null : ClassSourceUtil.getFor(rsc.getArchive().getURL());
  }
View Full Code Here

  protected ClassLoaderResource getResource (IClassArtifactReference reference) {
    return ClassLoaderScanner.getResource("META-INF/" + reference.getGroupId() + "/" + reference.getArtifactId() + "/pom.xml");
  }
 
  protected IClassPackageDescriptor getDescriptor (IClassArtifactReference reference) {
    ClassLoaderResource rsc = this.getResource(reference);
    return rsc == null ? null : XMLDocument.read(rsc.getFile(), ProjectObjectModel.class);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.common.classloader.ClassLoaderResource

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.