Java ClassPath existsInClasspath(final String fileName)

Here you can find the source of existsInClasspath(final String fileName)

Description

exists In Classpath

License

Apache License

Declaration

public static boolean existsInClasspath(final String fileName) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URL;

public class Main {
    public static boolean existsInClasspath(final String fileName) {
        return getResourceFromClasspath(fileName) != null;
    }//  w  w  w. j  a v  a  2s .c om

    public static URL getResourceFromClasspath(final String fileName) {
        return Thread.currentThread().getContextClassLoader().getResource(fileName);
    }
}

Related

  1. createClassLoader(List classpathElements, String... paths)
  2. createClassLoader(List libs, boolean useSystemClassPath)
  3. createClassPath(File file)
  4. dumpClasspath(ClassLoader loader)
  5. existsInClasspath(Class clazz, String fileName)
  6. fillClassPath(ClassLoader cl, StringBuffer classpath)
  7. findClassPaths()
  8. findClassPaths()
  9. findClasspathsByLoader(ClassLoader loader)