@Override public String getContent() { if (hasBeenCalledBefore) { return txt.toString(); } else { hasBeenCalledBefore = true; } // Placeholders: internalFileName, fileName, binary, width and height String[] arr = path.split("/"); String fileName = arr[arr.length - 1]; String internalFileName = System.currentTimeMillis() + fileName; // String binary = ImageUtils.getImageHexaBase64(path); String imageformat = path.substring(path.lastIndexOf('.') + 1); String binary = ImageUtils.getImageHexaBase64(bufferedImage, imageformat); setUpSize(); String res = img_template; res = res.replace("{fileName}", fileName); res = res.replace("{internalFileName}", internalFileName); res = res.replace("{binary}", binary); res = res.replace("{width}", width); res = res.replace("{height}", height); txt.append(res); return txt.toString(); }
@Override public String getContent() { if (hasBeenCalledBefore) { return txt.toString(); } else { hasBeenCalledBefore = true; } // Placeholders: internalFileName, fileName, binary, width and height String[] arr = path.split("/"); String fileName = arr[arr.length - 1]; String internalFileName = System.currentTimeMillis() + fileName; // String binary = ImageUtils.getImageHexaBase64(path); String imageformat = path.substring(path.lastIndexOf('.') + 1); String binary = ImageUtils.getImageHexaBase64(bufferedImage, imageformat); setUpSize(); String res = img_template; res = res.replace("{fileName}", fileName); res = res.replace("{internalFileName}", internalFileName); res = res.replace("{binary}", binary); res = res.replace("{width}", width); res = res.replace("{height}", height); txt.append(res); return txt.toString(); }