input = new byte[stream.available()];
stream.read(input);
} finally {
stream.close();
}
Attachment attachment = null;
attachment = document.getAttachment();
if (attachment == null) {
attachment = new Attachment();
document.setAttachment(attachment);
}
attachment.setName(this.uploadFileName);
document.setFileName(this.uploadFileName);
attachment.setContent(input);
}
if ("Account".equals(this.getRelationKey())) {
Account account = accountService.getEntityById(Account.class,
Integer.valueOf(this.getRelationValue()));