Java Resource Load getResourceAsFile(T testSuite, String resourceName)

Here you can find the source of getResourceAsFile(T testSuite, String resourceName)

Description

get Resource As File

License

Open Source License

Declaration

public static <T> File getResourceAsFile(T testSuite, String resourceName) 

Method Source Code


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

import java.io.File;
import java.io.InputStream;

public class Main {
    public static <T> File getResourceAsFile(T testSuite, String resourceName) {
        return new File(testSuite.getClass().getResource(resourceName).getPath());
    }//w  w w  .j  a v a2  s  . c om

    public static <T> InputStream getResource(T testSuite, String resourceName) {
        return testSuite.getClass().getResourceAsStream(resourceName);
    }
}

Related

  1. getResourceAsBytes(String path, ClassLoader loader)
  2. getResourceAsBytes(String url)
  3. getResourceAsFile(String path)
  4. getResourceAsFile(String resourceName)
  5. getResourceAsFile(String resourcePath)
  6. getResourceAsInputStream(Class resourceClass, String resourceName)
  7. getResourceAsProperties(String resource)
  8. getResourceAsReader(final Class classLocation, final String resourceName)
  9. getResourceAsReader(String name)