Class FileSuffixes

java.lang.Object
com.ibm.wala.core.util.io.FileSuffixes

public class FileSuffixes extends Object
Some simple utilities used to manipulate Strings
  • Constructor Details

    • FileSuffixes

      public FileSuffixes()
  • Method Details

    • isDexFile

      public static boolean isDexFile(URI uri)
      Does the URI refer to a .dex file?
      Throws:
      IllegalArgumentException - if uri is null
    • isDexFile

      public static boolean isDexFile(String fileName)
      Does the file name represent a .dex file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • isApkFile

      public static boolean isApkFile(String fileName)
      Does the file name represent a .dex file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • isClassFile

      public static boolean isClassFile(String fileName)
      Does the file name represent a .class file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • isSourceFile

      public static boolean isSourceFile(String fileName)
      Does the file name represent a .java file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • isJarFile

      public static boolean isJarFile(String fileName)
      Does the file name represent a .jar file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • isWarFile

      public static boolean isWarFile(String fileName)
      Does the file name represent a .war file?
      Parameters:
      fileName - name of a file
      Returns:
      boolean
      Throws:
      IllegalArgumentException - if fileName is null
    • stripSuffix

      public static String stripSuffix(String fileName)
      Strip the ".class" or ".java" suffix from a file name

      TODO: generalize for all suffixes

      Parameters:
      fileName - the file name
      Throws:
      IllegalArgumentException - if fileName is null
    • isRessourceFromJar

      public static boolean isRessourceFromJar(URI uri)
      Does the URI point to a ressource in a jar-file