Java ClassLoader Load getPath(final String fileName)

Here you can find the source of getPath(final String fileName)

Description

get Path

License

Apache License

Declaration

public static String getPath(final String fileName) 

Method Source Code

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

import java.net.URL;

public class Main {
    public static final String CLASSPATH = System.getProperty("java.class.path");

    public static String getPath(final String fileName) {
        final URL url = ClassLoader.getSystemResource(fileName);
        if (url != null) {
            return url.getFile();
        } else {/*from  w  w  w.  j  a v a2  s . c  o m*/
            throw new IllegalArgumentException(
                    "File " + fileName + " does not exist on the classpath: " + CLASSPATH);
        }
    }
}

Related

  1. getLibKoyaVersion()
  2. getLocalFile(final String aLocalPath)
  3. getLog4jPropertiesLocation()
  4. getManifestInfo()
  5. getMetadataSpecialSymbolsXml()
  6. getPath(String resoureLocation)
  7. getProhibitedProxyInterfaces()
  8. getProperties(String bundleName, String fileName)
  9. getProperty(String propertyName)