Java Resource Get getResourceBase()

Here you can find the source of getResourceBase()

Description

Gets the Resource Base (resource directory).

License

Open Source License

Declaration

public static URL getResourceBase() 

Method Source Code

//package com.java2s;
//  Use is subject to license terms.

import java.net.URL;

public class Main {
    private static final String RESOURCE_BASE_DIR = "resource/";
    private static ClassLoader classLoader = null;

    /**/*from w  ww .  jav a  2  s  . c  o m*/
     * Gets the Resource Base (resource directory). This is needed
     * for setting things like setBase() on HTML docuements.
     */
    public static URL getResourceBase() {
        if (classLoader == null) {
            return null;
        }

        return classLoader.getResource(RESOURCE_BASE_DIR);
    }
}

Related

  1. getResourceAsStream(Class aClass, String name)
  2. getResourceAsStream(final Class caller, final String resource)
  3. getResourceAsStream(String resourceLocation)
  4. getResourceAsString(String prefix, String resource)
  5. getResourceAsString(String resource)
  6. getResourceBundleLocaleString(String sKey, Object[] sParam, String sResourceBundle)
  7. getResourceContent(Object object, String resource)
  8. getResourceDir(final Class testClass)
  9. getResourceExpression(String select)