-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
generator/src/main/java/net/infumia/pack/PackReadFilters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package net.infumia.pack; | ||
|
||
import java.nio.file.Path; | ||
import java.util.function.Predicate; | ||
|
||
/** | ||
* Utility class for creating read filters for pack reading. | ||
*/ | ||
public final class PackReadFilters { | ||
|
||
/** | ||
* Creates a predicate that filters paths by the specified file extension. | ||
* | ||
* @param extension the file extension to filter by. Cannot be null. | ||
* @return a predicate that returns true for paths with the specified extension. | ||
*/ | ||
public static Predicate<Path> withExtension(final String extension) { | ||
return path -> path.getFileName().toString().endsWith(extension); | ||
} | ||
|
||
private PackReadFilters() { | ||
throw new IllegalStateException("Utility class"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters