- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {DateTime d =
new DateTime()
DateTimeFormatter formatter;String text;formatter.parseDateTime(text)
Object instant;new DateTime(instant)
- Smart code suggestions by Codota
}
attachmentManager.saveAttachment(attachment, previousVersionOfAttachment, inputContentStream);
private Attachment saveChartImageAsAttachment(ContentEntityObject attachmentContent, String attachmentMimeType, String attachmentFileName, byte[] chartImageBytes, String comment, Attachment currentVersionOfAttachment) throws IOException { Attachment previousVersionOfAttachment = null != currentVersionOfAttachment && currentVersionOfAttachment.isPersistent() ? (Attachment) currentVersionOfAttachment.clone() : null; Attachment chartImageAttachment = null == previousVersionOfAttachment ? new Attachment() : currentVersionOfAttachment; chartImageAttachment.setContainer(attachmentContent); chartImageAttachment.setMediaType(attachmentMimeType); chartImageAttachment.setVersionComment(comment); chartImageAttachment.setFileName(attachmentFileName); chartImageAttachment.setFileSize(chartImageBytes.length); if(null == previousVersionOfAttachment) attachmentContent.addAttachment(chartImageAttachment); attachmentManager.saveAttachment(chartImageAttachment, previousVersionOfAttachment, new ByteArrayInputStream(chartImageBytes)); return chartImageAttachment; }
getAttachmentManager().saveAttachment(attachmentCopy, null, attachmentInput); } catch (IOException e) { LOGGER.error("Error copying " + attachment + " to " + StringUtils.join(destinationResourcePathComponents, '/'));
attachmentManager.saveAttachment(newAttachment, null, in); in.close(); } catch (IOException e) {
attachmentManager.saveAttachment(newAttachment, null, in); in.close(); } catch (IOException e) {