Class ClasspathResourceSystem
- java.lang.Object
-
- net.officefloor.web.resource.classpath.ClasspathResourceSystem
-
- All Implemented Interfaces:
ResourceSystem
public class ClasspathResourceSystem extends java.lang.Object implements ResourceSystem
Locates aHttpFile
from aClassLoader
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ClasspathResourceSystem(ResourceSystemContext context, java.lang.ClassLoader classLoader)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassPathNode
getNode(java.lang.String path)
Obtains theClassPathNode
for resource path.java.nio.file.Path
getResource(java.lang.String path)
Obtains thePath
to the resource.
-
-
-
Constructor Detail
-
ClasspathResourceSystem
public ClasspathResourceSystem(ResourceSystemContext context, java.lang.ClassLoader classLoader) throws java.io.IOException
Instantiate.- Parameters:
context
-ResourceSystemContext
.classLoader
-ClassLoader
.- Throws:
java.io.IOException
- If fails to initiate resources from the class path.
-
-
Method Detail
-
getNode
public ClassPathNode getNode(java.lang.String path)
Obtains theClassPathNode
for resource path.- Parameters:
path
- Resource path.- Returns:
ClassPathNode
for resource path ornull
if no resource.
-
getResource
public java.nio.file.Path getResource(java.lang.String path) throws java.io.IOException
Description copied from interface:ResourceSystem
Obtains thePath
to the resource.- Specified by:
getResource
in interfaceResourceSystem
- Parameters:
path
- Path for the resource.- Returns:
Path
if resource found, otherwisenull
.- Throws:
java.io.IOException
- If failure in obtainingPath
.
-
-