-
-
- /**
- * Check whether to accept the given filename
- * @param inName name of file
- * @return true if accepted, false otherwise
- */
- private static boolean acceptPhotoFilename(String inName)
- {
- if (inName != null && inName.length() > 4)
- {
- // Check for three-character file extensions jpg and jpe
- String lastFour = inName.substring(inName.length() - 4).toLowerCase();
- if (lastFour.equals(".jpg") || lastFour.equals(".jpe"))
- {
- return true;
- }
- // If not found, check for file extension jpeg
- if (inName.length() > 5)
- {
- String lastFive = inName.substring(inName.length() - 5).toLowerCase();
- if (lastFive.equals(".jpeg"))
- {
- return true;
- }
- }
- }
- // Not matched so don't accept
- return false;
- }