Java Resource Path Get existsResource(String pathName)

Here you can find the source of existsResource(String pathName)

Description

exists Resource

License

Open Source License

Declaration

public static boolean existsResource(String pathName) 

Method Source Code

//package com.java2s;
/*//from ww  w. j  av a 2  s  .c o  m
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

import java.net.URL;

public class Main {
    public static boolean existsResource(String pathName) {
        URL url = ClassLoader.getSystemClassLoader().getResource(pathName);
        return (url != null);
    }
}

Related

  1. classToResource(String className)
  2. deserialize(Class parentOfResource, String resourcePath, Class targetClass)
  3. getAbsolutePathFromResource(Class reference, String resource)
  4. getAbsoluteResource(String path)
  5. getAlternateResourceFile(final String resourcePath)
  6. getBasePath(Class clazz, String resource)