Java ClassLoader Load getFile(final String name)

Here you can find the source of getFile(final String name)

Description

get File

License

Open Source License

Declaration

public static File getFile(final String name) throws URISyntaxException 

Method Source Code


//package com.java2s;
import java.io.File;
import java.net.URISyntaxException;

public class Main {
    public static File getFile(final String name) throws URISyntaxException {
        final File testFile = new File(Thread.currentThread().getContextClassLoader()
                .getResource("resources" + File.separator + name).toURI());
        return testFile;
    }//w w w  .  j a  v  a2s .  c o  m
}

Related

  1. getBytes(File file)
  2. getConfigFileInputStream(String configFilePath)
  3. getContentFromFile(String fileName, Object context)
  4. getDirectories(String path)
  5. getFile(final String filename)
  6. getFile(Object obj, String filename)
  7. getFileContents(String filename)
  8. getFileContents(String path)
  9. getFileFromPath(Object obj, String fileName)