java.lang.Object
xyz.ronella.trivial.handy.PathFinder
A class that will find the first existence of a file based on the directories provided.
- Since:
- 2.14.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe only class that can create an instance of PathFinder. -
Method Summary
Modifier and TypeMethodDescriptionstatic PathFinder.PathFinderBuildergetBuilder(String filename) The only method that can create an instance of PathFinder.getFile()Find the first existence of the file.Find the first existence of the file as InputStream.voidprocessInputStream(Consumer<InputStream> process) The InputStream of the resolved file.
-
Method Details
-
getFile
Find the first existence of the file.- Returns:
- The first existence of the file.
-
processInputStream
The InputStream of the resolved file. This method can use the ClassLoader as fallback.- Parameters:
process- The logic to process the InputStream.- Throws:
IOException- Thrown if there's an issue creating an instance of InputStream.
-
getInputStream
Find the first existence of the file as InputStream. This method can use the ClassLoader as fallback.- Returns:
- The InputStream of the file.
- Throws:
IOException- Thrown if there's an issue creating an instance of InputStream.- Since:
- 2.15.0
-
getBuilder
The only method that can create an instance of PathFinder.- Parameters:
filename- The filename to find the first existence.- Returns:
- An instance of PathFinderBuilder.
-