public static boolean isValid ( Resource resource ) { return resource instanceof ResourceHandle ? ( ( ResourceHandle ) resource ) . isValid ( ) : resource != null && resource . getResourceResolver ( ) . getResource ( resource . getPath ( ) ) != null ; }
the universal validation test