Package com.sk89q.worldedit.util.io
Interface ResourceLoader
- All Known Implementing Classes:
WorldEditResourceLoader
public interface ResourceLoader
An abstract loader that handles loading resources from bundled URLs or local
files.
-
Method Summary
Modifier and TypeMethodDescriptiongetLocalResource
(String pathName) Gets thePath
reference to this local resource.default URL
getResource
(Class<?> clazz, String pathName) Gets the bundled resource URL by name, relative to the provided class.default URL
getRootResource
(String pathName) Gets the bundled resource URL by name.
-
Method Details
-
getResource
Gets the bundled resource URL by name, relative to the provided class.The path name must not start with
/
.- Parameters:
clazz
- The class to search relative topathName
- The path name- Returns:
- The URL to this bundled resource
- Throws:
IOException
- if an IO issue occurs
-
getRootResource
Gets the bundled resource URL by name.The path name must not start with
/
. It is always absolute.- Parameters:
pathName
- The path name- Returns:
- The URL to this bundled resource
- Throws:
IOException
- if an IO issue occurs
-
getLocalResource
Gets thePath
reference to this local resource. The file may not exist.- Parameters:
pathName
- The path name- Returns:
- The path reference
-