@Override public RestFieldOperationsHandler getRestFieldOperation() { // this guy needs the IssueService and the IssueService needs the IssueLinksSystemField. so // let's break up // the circular dependency... IssueFinder issueFinder = ComponentAccessor.getComponent(IssueFinder.class); return new IssueLinksRestFieldOperationsHandler( i18nFactory.getInstance(authenticationContext.getLoggedInUser()), issueLinkTypeFinder, issueFinder); }
void createAttachmentOnDisk(Attachment attachment, final File file, User user) throws AttachmentException { try { attachmentStore .putAttachment(attachment, new BufferedInputStream(new FileInputStream(file))) .claim(); // This will throw some kind of AttachmentRuntimeException } catch (Exception e) { final String message = i18nBeanFactory.getInstance(user).getText("attachfile.error.save.to.store", e); log.error(message, e); throw new AttachmentException(message, e); } finally { file.delete(); } }