Class UResourceImpl

java.lang.Object
ushiosan.jvm.internal.validators.UResourceValidator
ushiosan.jvm.internal.filesystem.UResourceImpl
Direct Known Subclasses:
UResource

public abstract class UResourceImpl extends UResourceValidator
  • Constructor Details

    • UResourceImpl

      public UResourceImpl()
  • Method Details

    • regexPathOf

      @NotNull public static <T extends Path> @NotNull Predicate<T> regexPathOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, boolean inverted, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexPathOf

      @NotNull public static <T extends Path> @NotNull Predicate<T> regexPathOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexPathOf

      @NotNull public static <T extends Path> @NotNull Predicate<T> regexPathOf(@NotNull @NotNull Pattern pattern, boolean fullPath, boolean inverted)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
      See Also:
    • namedPathOf

      @NotNull public static <T extends Path> @NotNull Predicate<T> namedPathOf(boolean inverted, String @NotNull ... names)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      names - the resource possible names
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • extensionsPathOf

      @NotNull public static <T extends Path> @NotNull Predicate<T> extensionsPathOf(boolean inverted, String @NotNull ... extensions)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      extensions - the resource possible extensions
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • regexFileOf

      @NotNull public static <T extends File> @NotNull Predicate<T> regexFileOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, boolean inverted, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexFileOf

      @NotNull public static <T extends File> @NotNull Predicate<T> regexFileOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexFileOf

      @NotNull public static <T extends File> @NotNull Predicate<T> regexFileOf(@NotNull @NotNull Pattern pattern, boolean fullPath, boolean inverted)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
      See Also:
    • namedFileOf

      @NotNull public static <T extends File> @NotNull Predicate<T> namedFileOf(boolean inverted, String @NotNull ... names)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      names - the resource possible names
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • extensionsFileOf

      @NotNull public static <T extends File> @NotNull Predicate<T> extensionsFileOf(boolean inverted, String @NotNull ... extensions)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      extensions - the resource possible extensions
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • regexEntryOf

      @NotNull public static <T extends ZipEntry> @NotNull Predicate<T> regexEntryOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, boolean inverted, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexEntryOf

      @NotNull public static <T extends ZipEntry> @NotNull Predicate<T> regexEntryOf(@NotNull @RegExp @NotNull String pattern, boolean fullPath, @MagicConstant(flagsFromClass=java.util.regex.Pattern.class) int @NotNull ... flags)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      flags - regular expression configuration flags
      Returns:
      the filter instance with the desired behavior
      See Also:
    • regexEntryOf

      @NotNull public static <T extends ZipEntry> @NotNull Predicate<T> regexEntryOf(@NotNull @NotNull Pattern pattern, boolean fullPath, boolean inverted)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      pattern - regular expression to apply
      fullPath - property used to parse the full path or just the file name for matches
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
      See Also:
    • namedEntryOf

      @NotNull public static <T extends ZipEntry> @NotNull Predicate<T> namedEntryOf(boolean inverted, String @NotNull ... names)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      names - the resource possible names
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • extensionsEntryOf

      @NotNull public static <T extends ZipEntry> @NotNull Predicate<T> extensionsEntryOf(boolean inverted, String @NotNull ... extensions)
      Generates a filter to capture the elements that meet said restriction
      Type Parameters:
      T - generic member type
      Parameters:
      extensions - the resource possible extensions
      inverted - option to perform the action inverted
      Returns:
      the filter instance with the desired behavior
    • jrtModuleName

      @NotNull protected static @NotNull Optional<String> jrtModuleName(@NotNull @NotNull URI uri)
      Gets the file module within a URI object for a jrt:/ filesystem
      Parameters:
      uri - the URI where the file is located
      Returns:
      the file module name or Optional.empty() if the module is not found.
    • jrtFileAccess

      @NotNull protected static @NotNull String jrtFileAccess(@NotNull @NotNull URI uri)
      Gets the file path within a URI object for a jrt:/ filesystem
      Parameters:
      uri - the URI where the file is located
      Returns:
      the file path or empty text if the file is not found.