Here you can find the source of isResource(URI uri)
public static boolean isResource(URI uri)
//package com.java2s; import java.net.URI; public class Main { /**//from w w w . j a va 2s .c om * @return whether this URI represents a resource. */ public static boolean isResource(URI uri) { String scheme = uri.getScheme(); return scheme.equals("resource") || scheme.equals("classpath") || scheme.startsWith("jar"); } }