Package edu.tufts.hrilab.util.resource
Class Resources
java.lang.Object
edu.tufts.hrilab.util.resource.Resources
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createFilepath
(String dir, String filename) Helper method to pre-pend dir to filename if the dir/filename combination results in a valid file, otherwise filename is returned.static URL
getResource
(String dir, String filename) Helper method to get a resource.
-
Constructor Details
-
Resources
public Resources()
-
-
Method Details
-
createFilepath
Helper method to pre-pend dir to filename if the dir/filename combination results in a valid file, otherwise filename is returned. This is a utility method only for loading files from the classpath.- Parameters:
dir
- directory pathfilename
- name of file- Returns:
-
getResource
Helper method to get a resource. Attempts to use the dir/filename combination to find a resource, otherwise just the filename is used.- Parameters:
dir
- directory pathfilename
- name of file- Returns:
-