In my application, when we browse the file from the SD card, the files will be .text, .jpg and mpeg4ie video files.
I want to store each file type into a particular folder. For example, .text files go to the text folder. When I select the file, how do I check the file extension?
You can use FilenameUtils from Apache Commons:
Stuff is .endsWith("your extension"):
Here the
videouri
variable has a video. I mean:under onResultActivity.
You can pass any variable here such as an image, video, MP3, and file/documents. It will work for all type of contents.
It's a corporate code mostly used for commercial purposes.
I'm 100 % sure it will work with confidence...
I have found a nice example at docs.oracle.com on how to get the file extension that returns the file type extension in lower case or null if there isn't a file extension: