Java ClassLoader Load getLocalFile(final String aLocalPath)

Here you can find the source of getLocalFile(final String aLocalPath)

Description

get Local File

License

Open Source License

Parameter

Parameter Description
aLocalPath The path to the file which should be loaded.

Return

The local file.

Declaration

public static File getLocalFile(final String aLocalPath) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.net.URISyntaxException;

public class Main {
    /**//from w  w  w . j ava 2 s  .c om
     * @param aLocalPath
     *            The path to the file which should be loaded.
     * @return The local file.
     */
    public static File getLocalFile(final String aLocalPath) {
        try {
            return new File(ClassLoader.getSystemResource("").toURI().getPath(), aLocalPath);
        } catch (final URISyntaxException uiUriSyntaxException) {
            throw new IllegalStateException("This is a critical error. Please report it.", uiUriSyntaxException);
        }
    }
}

Related

  1. getFilesInPackage(String packageName)
  2. getFullPathByPkg(String pkg)
  3. getImageFilename(String name)
  4. getInputStream(String name)
  5. getLibKoyaVersion()
  6. getLog4jPropertiesLocation()
  7. getManifestInfo()
  8. getMetadataSpecialSymbolsXml()
  9. getPath(final String fileName)