I recently discovered that images taken with Google Hangouts sometimes add: nopm: to the end of the file name. For example, DCIM / Camera / IMG_20141212_123123: nopm: .jpg
This causes me a lot of parsing problems. One of the biggest was that when I created the File object from this path and tried file.exists (), I GOT FALSE !!!!!
My ultimate goal is that when I come across one of the following: nopm: images, I would just like to rename it on the device and continue processing as usual.
Here is my code:
public static void checkForNopm(File file) { final String path = file.getPath(); if (path.contains(":nopm:")) { final File newfile = new File(file.getPath().replace(":nopm:","")); file.renameTo(newfile); } }
android file image google-hangouts
The hungry androider
source share