public String saveInBundle(String name) { if (!name.endsWith(".png")) { name += ".png"; } if (!name.startsWith("_")) { name = "_" + name; } File fImage = new File(name); try { fImage = new File(ImagePath.getBundlePath(), name); createFile(fImage); Debug.log(3, "ScreenImage.saveInBundle:\n%s", fImage); } catch (IOException iOException) { Debug.error("ScreenImage.saveInBundle: IOException", iOException); return null; } Image.reload(fImage.getAbsolutePath()); return fImage.getAbsolutePath(); }
/** * stores the image as PNG file in the given path * with the given filename * * @param path valid path string * @param name filename (.png is added if not present) * @return absolute path to stored file */ public String getFile(String path, String name) { if (name == null) { name = Settings.getTimestamp() + ".png"; } else if (!name.endsWith(".png")) { name += ".png"; } try { File tmp = new File(path, name); createFile(tmp); Debug.log(3, "ScreenImage.getFile:\n%s", tmp); } catch (IOException iOException) { Debug.error("ScreenImage.getFile: IOException", iOException); return null; } return _filename; }