Class ResourceDistributor
java.lang.Object
com.jackmeng.halcyoninae.halcyon.utils.ResourceDistributor
Retrieves resources from the binary resource folder.
This resource folder is not located externally and is packed in during compilation to the generated binary.
This class should not be confused with ExternalResource
as that class handles external resources, while this class handles internal resources.
- Since:
- 2.1
- Author:
- Jack Meng
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFromAsBufferedImage
(String path) Retrieve a resource as a BufferedImagegetFromAsFile
(String path) Gets a standard file from the resource folder.getFromAsImageIcon
(String path) Gets an ImageIcon from the resource folder.getFromAsStream
(String path) Similar to other methods but returns asInputStream
getFromAsURL
(String path) Similar to other methods but returns asURL
-
Constructor Details
-
ResourceDistributor
public ResourceDistributor()
-
-
Method Details
-
getFromAsImageIcon
Gets an ImageIcon from the resource folder.- Parameters:
path
- The path to the image- Returns:
- ImageIcon The image icon
-
getFromAsFile
Gets a standard file from the resource folder.- Parameters:
path
- The path to the file- Returns:
- File The file
-
getFromAsURL
Similar to other methods but returns asURL
- Parameters:
path
-- Returns:
-
getFromAsStream
Similar to other methods but returns asInputStream
- Parameters:
path
-- Returns:
-
getFromAsBufferedImage
Retrieve a resource as a BufferedImage- Parameters:
path
- The path to the suspected resource- Returns:
- The BufferedImage or null if not found
-