Package com.google.code.yanf4j.util
Class ResourcesUtils
java.lang.Object
com.google.code.yanf4j.util.ResourcesUtils
Resource utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic File
getResourceAsFile
(ClassLoader loader, String resource) Returns a resource on the classpath as a File objectstatic File
getResourceAsFile
(String resource) Returns a resource on the classpath as a File objectstatic Properties
getResourceAsProperties
(ClassLoader loader, String resource) Returns a resource on the classpath as a Properties objectstatic Properties
getResourceAsProperties
(String resource) Returns a resource on the classpath as a Properties objectstatic Reader
getResourceAsReader
(ClassLoader loader, String resource) Returns a resource on the classpath as a Reader objectstatic InputStreamReader
getResourceAsReader
(String resource) Returns a resource on the classpath as a Reader objectstatic InputStream
getResourceAsStream
(ClassLoader loader, String resource) Returns a resource on the classpath as a Stream objectstatic InputStream
getResourceAsStream
(String resource) Returns a resource on the classpath as a Stream objectstatic URL
getResourceURL
(ClassLoader loader, String resource) Returns the URL of the resource on the classpathstatic URL
getResourceURL
(String resource) Returns the URL of the resource on the classpath
-
Constructor Details
-
ResourcesUtils
public ResourcesUtils()
-
-
Method Details
-
getResourceURL
Returns the URL of the resource on the classpath- Parameters:
resource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceURL
Returns the URL of the resource on the classpath- Parameters:
loader
- The classloader used to load the resourceresource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsStream
Returns a resource on the classpath as a Stream object- Parameters:
resource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsStream
public static InputStream getResourceAsStream(ClassLoader loader, String resource) throws IOException Returns a resource on the classpath as a Stream object- Parameters:
loader
- The classloader used to load the resourceresource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsProperties
Returns a resource on the classpath as a Properties object- Parameters:
resource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsProperties
public static Properties getResourceAsProperties(ClassLoader loader, String resource) throws IOException Returns a resource on the classpath as a Properties object- Parameters:
loader
- The classloader used to load the resourceresource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsReader
Returns a resource on the classpath as a Reader object- Parameters:
resource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsReader
Returns a resource on the classpath as a Reader object- Parameters:
loader
- The classloader used to load the resourceresource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsFile
Returns a resource on the classpath as a File object- Parameters:
resource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-
getResourceAsFile
Returns a resource on the classpath as a File object- Parameters:
loader
- The classloader used to load the resourceresource
- The resource to find- Returns:
- The resource
- Throws:
IOException
- If the resource cannot be found or read
-