Package com.ibm.wala.util.io
Class FileSuffixes
- java.lang.Object
-
- com.ibm.wala.util.io.FileSuffixes
-
public class FileSuffixes extends Object
Some simple utilities used to manipulate Strings
-
-
Constructor Summary
Constructors Constructor Description FileSuffixes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isApkFile(String fileName)
Does the file name represent a .dex file?static boolean
isClassFile(String fileName)
Does the file name represent a .class file?static boolean
isDexFile(String fileName)
Does the file name represent a .dex file?static boolean
isDexFile(URI uri)
Does the URI refer to a .dex file?static boolean
isJarFile(String fileName)
Does the file name represent a .jar file?static boolean
isRessourceFromJar(URI uri)
Does the URI point to a ressource in a jar-filestatic boolean
isSourceFile(String fileName)
Does the file name represent a .java file?static boolean
isWarFile(String fileName)
Does the file name represent a .war file?static String
stripSuffix(String fileName)
Strip the ".class" or ".java" suffix from a file name TODO: generalize for all suffixes
-
-
-
Method Detail
-
isDexFile
public static boolean isDexFile(URI uri)
Does the URI refer to a .dex file?- Parameters:
uri
-- Returns:
- boolean
- 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
-
-