Class PathUtils

java.lang.Object
sootup.core.util.PathUtils

public class PathUtils extends Object
Common functionality useful to cope with Paths.
Author:
Manuel Benz created on 06.06.18
  • Constructor Details

    • PathUtils

      public PathUtils()
  • Method Details

    • hasExtension

      public static boolean hasExtension(@NonNull Path path, @NonNull FileType... extensions)
      Matches the given Path with the file extensions of the given FileTypes.
      Parameters:
      path - An arbitrary Path
      extensions - One or more FileTypes to check against
      Returns:
      True if the given Path has the given FileType, i.e., the path ends with a dot followed by either of the extensions defined by the given FileTypes otherwise.
    • hasExtension

      public static boolean hasExtension(@NonNull Path path, @NonNull Collection<FileType> extensions)
      Matches the given Path with the file extensions of the given FileTypes.
      See Also:
    • endsWithIgnoreCase

      public static boolean endsWithIgnoreCase(String str, String suffix)
    • isArchive

      public static boolean isArchive(@NonNull Path path)