I am using play framework 1.2+ – I can save an image to disk using play.db.jpa.blob – I am wondering if I can specify the file name using this – if not, I’ll just end up using regular File.
//File photo;
testImage.photoFileName = photo.getName();
testImage.photo = new Blob();
testImage.photo.set(new FileInputStream(photo), MimeTypes.getContentType(photo.getName()));
any helpful suggestions will be welcome. The file name on the OS is using a UUID – the getName on the File returns the actual name specified for the file – I need to specify the file name for the file so that I can read it from the directory later on.
used the javax.imageio.ImageIO.write call (passing in a BufferedImage, file type (png/jpeg etc.) & directory location of file (with the desired file name).