Package jadx.core.utils.files
Class FileUtils
java.lang.Object
jadx.core.utils.files.FileUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFileToJar(JarOutputStream jar, File source, String entryName) static StringbuildInputsHash(List<Path> inputPaths) Hash timestamps of input filesstatic StringbytesToHex(byte[] bytes) static StringbyteToHex(int value) Zero padded hex string for first bytestatic voidstatic voidstatic voidstatic voidcopyStream(InputStream input, OutputStream output) static PathcreateTempDir(String prefix) Deprecated.static PathcreateTempFile(String suffix) Deprecated.static PathcreateTempFileNoDelete(String suffix) Deprecated.static PathcreateTempFileNonPrefixed(String fileName) Deprecated.private static Pathstatic FilecutFileName(File file) static booleanstatic voidprivate static voidstatic voiddeleteDirIfExists(Path dir) static voiddeleteFileIfExists(Path filePath) private static voidexpandDirs(List<Path> paths) fileNamesToPaths(List<String> fileNames) static StringgetPathBaseName(Path file) static booleanhasExtension(Path path, String extension) static StringintToHex(int value) Zero padded hex string for int valuestatic booleanstatic voidstatic voidstatic voidmakeDirsForFile(File file) static voidmakeDirsForFile(Path path) static Stringmd5Sum(byte[] data) static Stringstatic @NotNull FileprepareFile(File file) static Stringstatic booleanrenameFile(Path sourcePath, Path targetPath) static byte[]streamToByteArray(InputStream input) static StringstreamToString(InputStream input) static FiletoPathsWithTrim(File[] files) static PathtoPathWithTrim(File file) static PathtoPathWithTrim(String file) static PathupdateTempRootDir(Path newTempRootDir) static voidstatic voidwriteFile(Path file, InputStream is) static void
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
READ_BUFFER_SIZE
public static final int READ_BUFFER_SIZE- See Also:
-
MAX_FILENAME_LENGTH
private static final int MAX_FILENAME_LENGTH- See Also:
-
MAX_UNIQUE_ID_LENGTH
private static final int MAX_UNIQUE_ID_LENGTH- See Also:
-
JADX_TMP_INSTANCE_PREFIX
- See Also:
-
JADX_TMP_PREFIX
- See Also:
-
tempRootDir
-
MKDIR_SYNC
-
HEX_ARRAY
private static final byte[] HEX_ARRAY -
ZIP_FILE_MAGIC
private static final byte[] ZIP_FILE_MAGIC
-
-
Constructor Details
-
FileUtils
private FileUtils()
-
-
Method Details
-
updateTempRootDir
-
createTempRootDir
-
listFiles
-
listFiles
-
expandDirs
-
expandDir
-
addFileToJar
public static void addFileToJar(JarOutputStream jar, File source, String entryName) throws IOException - Throws:
IOException
-
makeDirsForFile
-
makeDirsForFile
-
makeDirs
-
makeDirs
-
deleteFileIfExists
- Throws:
IOException
-
deleteDir
-
deleteDir
-
deleteDirIfExists
-
deleteDir
-
clearTempRootDir
public static void clearTempRootDir() -
clearDir
-
createTempDir
Deprecated.Deprecated. Migrate toIJadxFilesGetterfrom jadx args to get temp dir -
createTempFile
Deprecated.Deprecated. Migrate toIJadxFilesGetterfrom jadx args to get temp dir -
createTempFileNoDelete
Deprecated.Deprecated. PreferIJadxFilesGetterfrom jadx args to get temp dir -
createTempFileNonPrefixed
Deprecated.Deprecated. Migrate toIJadxFilesGetterfrom jadx args to get temp dir -
copyStream
- Throws:
IOException
-
streamToByteArray
- Throws:
IOException
-
streamToString
- Throws:
IOException
-
close
-
writeFile
- Throws:
IOException
-
writeFile
- Throws:
IOException
-
writeFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
renameFile
-
prepareFile
-
cutFileName
-
bytesToHex
-
byteToHex
Zero padded hex string for first byte -
intToHex
Zero padded hex string for int value -
isZipFile
-
getPathBaseName
-
hasExtension
-
toFile
-
toPaths
-
toPaths
-
toPathsWithTrim
-
toPathWithTrim
-
toPathWithTrim
-
fileNamesToPaths
-
toFiles
-
md5Sum
-
md5Sum
-
buildInputsHash
Hash timestamps of input files
-