|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.seventytwomiles.springframework.core.io.ClassPathResource
public class ClassPathResource
These classes are all extracted from the Spring Framework in order to remove the dependency on the Spring library.
| Constructor Summary | |
|---|---|
|
ClassPathResource(String path)
Create a new ClassPathResource for ClassLoader usage. |
|
ClassPathResource(String path,
Class clazz)
Create a new ClassPathResource for Class usage. |
|
ClassPathResource(String path,
ClassLoader classLoader)
Create a new ClassPathResource for ClassLoader usage. |
protected |
ClassPathResource(String path,
ClassLoader classLoader,
Class clazz)
Create a new ClassPathResource with optional ClassLoader
and Class. |
| Method Summary | |
|---|---|
boolean |
equals(Object object)
This implementation compares the underlying class path locations. |
boolean |
exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. |
File |
getFile()
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassPathResource(String path)
Create a new ClassPathResource for ClassLoader usage. A
leading slash will be removed, as the ClassLoader resource access methods
will not accept it. The thread context class loader will be used for
loading the resource.
path - the absolute path within the class pathClassLoader.getResourceAsStream(String)
public ClassPathResource(String path,
ClassLoader classLoader)
Create a new ClassPathResource for ClassLoader usage. A
leading slash will be removed, as the ClassLoader resource access methods
will not accept it.
path - the absolute path within the classpathclassLoader - the class loader to load the resource with, or
null for the thread context class loaderClassLoader.getResourceAsStream(String)
public ClassPathResource(String path,
Class clazz)
Create a new ClassPathResource for Class usage. The path
can be relative to the given class, or absolute within the classpath via
a leading slash.
path - relative or absolute path within the class pathclazz - the class to load resources withClass.getResourceAsStream(java.lang.String)
protected ClassPathResource(String path,
ClassLoader classLoader,
Class clazz)
Create a new ClassPathResource with optional ClassLoader
and Class. Only for internal usage.
path - relative or absolute path within the classpathclassLoader - the class loader to load the resource with, if anyclazz - the class to load resources with, if any| Method Detail |
|---|
public File getFile()
throws IOException
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
IOException - when file not foundpublic boolean equals(Object object)
This implementation compares the underlying class path locations.
equals in class Objectpublic boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||