Java ClassLoader Load getAbsoluteBasePath()

Here you can find the source of getAbsoluteBasePath()

Description

get Absolute Base Path

License

LGPL

Declaration

public static String getAbsoluteBasePath() 

Method Source Code

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

import java.net.URL;

public class Main {
    public static String APPS_JAR_DIRECTORY;
    private static String absoluteBasePath;

    public static String getAbsoluteBasePath() {
        if (absoluteBasePath == null) {
            if (APPS_JAR_DIRECTORY != null) {
                absoluteBasePath = APPS_JAR_DIRECTORY;
            } else {
                URL url = Thread.currentThread().getContextClassLoader().getResource("schemas/common.xsd");
                absoluteBasePath = url.getPath();
                absoluteBasePath = absoluteBasePath.substring(0, absoluteBasePath.length() - 18); // remove schemas/common.xsd
                absoluteBasePath = absoluteBasePath.replace('\\', '/');
            }/*from  www.  j  a v a  2  s .com*/
        }

        return absoluteBasePath;
    }
}

Related

  1. get(final String key, final String filename)
  2. getAbsolutePath(String file)
  3. getAbsolutePathEssenceDesc(String file)
  4. getAllArquillianLibs()
  5. getAsProperties(final String name)