+ digits = suggesteddigits;
+ }
+
+ String savedFilename = "";
+ // if extensionOnly is set then reset the filename to the last occurrence of the extension+templateStart and try the match
+ if (extensionMatch)
+ {
+ // only trying to match from extension onwards
+
+ int extensioncharstart = filename
+ .lastIndexOf('.' + base + templateStart);
+ if (extensioncharstart == -1)
+ {
+ return;
+ }
+
+ savedFilename = filename.substring(0, extensioncharstart + 1); // include
+ // the "."
+ filename = filename.substring(extensioncharstart + 1);