Hi all,
When attempting to save a complex obs through a handler that saves to disk (= that will leverage on AbstractHandler
), it is possible to keep providing the same file name over and over again. The file saved on disk will be appended with a counter suffix:
- image.jpeg
- image_01.jpeg
- image_02.jpeg
- …
- image_98.jpeg
- image_99.jpeg
However it won’t go further than a 2-digit suffix:
// If the Obs does not exist, but the File does, append a two-digit
// count number to the filename and save it.
while (obs.getObsId() == null && outputfile.exists() && i < 100) { ...
… as confirmed by the i < 100
condition (and the comment).
(Q.) Why this behaviour, why not just ensure that some unique name will be generated for the file saved on disk?
If there is no good reason for this, we would be keen on seeing this go away as we have painfully hit a wall with this. One of our clients uses iPad to upload images through VDUI and, as it turns out, files generated out of the iPad’s camera app are always wired as ‘image.jpeg’. How unfortunate… We have fixed hastily VDUI so that it time stamps every file anyway, but the damage had to be endured for some time in production