I have file for example 5555.33 but in fact file is arj archive file
String ext = FilenameUtils.getExtension("C:\\5555.33");
the Extension returns 33 file. How to get actual file type arj from this file
I have file for example 5555.33 but in fact file is arj archive file
String ext = FilenameUtils.getExtension("C:\\5555.33");
the Extension returns 33 file. How to get actual file type arj from this file
ARJ archive files start with 0x60, 0xEA bytes. Just read the first two bytes to determine whether file is ARJ archive or not.
It seems like you want the content after '.' . For this you can try
String str = "abc.txt";
System.out.println(str.substring(str.lastIndexOf(".")+1));
You can use
Files.probeContentType(path)
to know what type of file it is refered to