本文整理了Java中com.atlassian.jira.issue.attachment.Attachment.getId()
方法的一些代码示例,展示了Attachment.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attachment.getId()
方法的具体详情如下:
包路径:com.atlassian.jira.issue.attachment.Attachment
类名称:Attachment
方法名:getId
暂无
代码示例来源:origin: com.atlassian.jira/jira-core
private <A> Map<Long, A> fillMap(final List<Attachment> attachments, final Function<Attachment, A> f)
{
final ImmutableMap.Builder<Long, A> builder = ImmutableMap.builder();
for (final Attachment attachment : attachments) {
builder.put(attachment.getId(), f.apply(attachment));
}
return builder.build();
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public Either<AttachmentError, Attachment> copyAttachment(final Attachment attachment,
@Nullable final ApplicationUser author, final String newIssueKey)
{
return copyAttachments(Collections.singletonList(attachment), author, newIssueKey).get(attachment.getId());
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public void deleteThumbnailForAttachment(@Nullable final Issue issue, final Attachment attachment)
{
if (isThumbnailable(issue, attachment))
{
final File thumbnailFile = getThumbnailFile(issue, attachment);
if (thumbnailFile.exists() && !thumbnailFile.delete())
{
log.debug("Unable to delete thumbnail for attachment {}", attachment.getId());
}
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public void removeAttachmentIndex(final @Nonnull Attachment attachment, final @Nonnull Issue issue)
{
jsonEntityPropertyManager.delete(entityDbName, issue.getId(), attachment.getId().toString());
}
代码示例来源:origin: com.atlassian.streams/streams-jira-plugin
public URI getAttachmentUri(URI baseUri, Attachment attachment)
{
return URI.create(baseUri.toASCIIString() + "/secure/attachment/" +
attachment.getId() + "/" + Uris.encode(attachment.getFilename()));
}
代码示例来源:origin: com.atlassian.jira/jira-core
@Override
public ChangeItemBean apply(final Attachment attachment)
{
return new ChangeItemBean(
ChangeItemBean.STATIC_FIELD, "Attachment", null, null,
attachment.getId().toString(), attachment.getFilename()
);
}
};
代码示例来源:origin: com.atlassian.jira/jira-core
private void processAttachment(final @Nonnull String index, final @Nonnull Attachment attachment,
final @Nonnull Issue issue)
{
jsonEntityPropertyManager.put(null, entityDbName, issue.getId(), attachment.getId().toString(), index,
issuePropertyHelper.createSetPropertyEventFunction(), true);
}
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public boolean authorize(final Attachment attachment, @Nullable final ApplicationUser user)
{
final Long attachmentId = attachment.getId();
final JiraServiceContext serviceContext = contextFactory.createContext(user);
return attachmentService.canDeleteAttachment(serviceContext, attachmentId);
}
代码示例来源:origin: com.atlassian.jira/jira-api
static AttachmentAdapter fromAttachment(final Attachment attachment)
{
return new AttachmentAdapter(attachment.getId(), attachment.getFilename());
}
}
代码示例来源:origin: com.atlassian.jira/jira-attachment-dmz
public static AttachmentAdapterImpl fromAttachment(final Attachment attachment)
{
return new AttachmentAdapterImpl(attachment.getId(), attachment.getFilename());
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
Issue getAndVerifyIssue(Attachment attachment, ErrorCollection errorCollection)
{
Issue issue = attachment.getIssueObject();
if (issue == null)
{
errorCollection.addErrorMessage(getText("attachment.service.error.null.issue.for.attachment", attachment.getId().toString()));
return null;
}
return issue;
}
代码示例来源:origin: com.atlassian.jira/jira-attachment-dmz
public static AttachmentKey from(final String originalProjectKey, final String issueKey, final Attachment attachment)
{
return from(originalProjectKey, issueKey, attachment.getFilename(), attachment.getId());
}
代码示例来源:origin: com.atlassian.jira/jira-core
private String buildAttachmentUrl(RenderContext context, Attachment attachment)
{
String encodedAttachmentId;
String encodedFilename;
try
{
encodedAttachmentId = URLCodec.encode(attachment.getId().toString(), context.getCharacterEncoding());
encodedFilename = URLCodec.encode(attachment.getFilename(), context.getCharacterEncoding());
}
catch (UnsupportedEncodingException uee)
{
encodedAttachmentId = attachment.getId().toString();
encodedFilename = attachment.getFilename();
}
return context.getSiteRoot() + "/secure/attachment/" + encodedAttachmentId + "/" + encodedAttachmentId + "_" + encodedFilename;
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
private String buildAttachmentUrl(RenderContext context, Attachment attachment) throws UnsupportedEncodingException
{
String encodedAttachmentId = URLCodec.encode(attachment.getId().toString(), context.getCharacterEncoding());
return context.getSiteRoot() + "/secure/attachment/" + encodedAttachmentId + "/" + encodedAttachmentId + "_" +
URLCodec.encode(attachment.getFilename(), context.getCharacterEncoding());
}
代码示例来源:origin: com.atlassian.jira/jira-core
private RendererAttachment convertToRendererAttachment(Attachment attachment, RenderContext context, EmbeddedResource resource)
{
return new RendererAttachment(attachment.getId().longValue(), attachment.getFilename(), attachment.getMimetype(),
attachment.getAuthorKey(), null, buildAttachmentUrl(context, attachment), null, null, attachment.getCreated());
}
代码示例来源:origin: com.atlassian.jira.plugins/atlassian-jira-rpc-plugin
public RemoteAttachment(Attachment attachment)
{
super(attachment.getId().toString());
author = getUsernameFor(attachment.getAuthorObject());
created = attachment.getCreated();
filename = attachment.getFilename();
filesize = attachment.getFilesize();
mimetype = attachment.getMimetype();
}
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public Response perform(final Attachment attachment, final JiraServiceContext context)
{
final Long attachmentId = attachment.getId();
attachmentService.delete(context, attachmentId);
final ErrorCollection errors = context.getErrorCollection();
if (errors.hasAnyErrors())
{
return responder.errors(errors);
}
else
{
return responder.successfulDelete();
}
}
}
代码示例来源:origin: com.atlassian.jira/jira-rest-plugin
@Override
public HumanReadableArchive format(final AttachmentArchive archive, final Attachment attachment)
{
final Long id = attachment.getId();
final List<AttachmentArchiveEntry> entries = archive.getEntries();
final Collection<HumanReadableArchiveEntry> convertedEntries = convertEntries(entries);
final String name = attachment.getFilename();
final int totalEntryCount = archive.getTotalEntryCount();
final String mediaType = attachment.getMimetype();
return new HumanReadableArchive(id, name, convertedEntries, totalEntryCount, mediaType);
}
代码示例来源:origin: com.atlassian.jira/jira-core
IssueUpdateBean constructIssueUpdateBeanForAttachmentDelete(Attachment attachment, Issue issue, ApplicationUser user)
{
//generate change history for issue to show that attachment has been deleted
ChangeItemBean changeItem = new ChangeItemBean(ChangeItemBean.STATIC_FIELD, "Attachment", attachment.getId().toString(), attachment.getFilename(), null, null);
List<ChangeItemBean> changeItemBeans = EasyList.build(changeItem);
//configure issue update event
IssueUpdateBean issueUpdateBean = new IssueUpdateBean(issue.getGenericValue(), issue.getGenericValue(), EventType.ISSUE_UPDATED_ID, user);
issueUpdateBean.setChangeItems(changeItemBeans);
issueUpdateBean.setDispatchEvent(true);
issueUpdateBean.setParams(MapBuilder.build("eventsource", IssueEventSource.ACTION));
return issueUpdateBean;
}
代码示例来源:origin: com.atlassian.jira/jira-core
private StoreAttachmentBean mapAttachmentToStoreBean(final Attachment metadata, final StoreAttachmentBean.Builder builder)
{
return builder
.withId(metadata.getId())
.withFileName(metadata.getFilename())
.withSize(metadata.getFilesize())
.withIssueKey(metadata.getIssue().getKey())
.withOriginalProjectKey(metadata.getIssue().getProjectObject().getOriginalKey())
.build();
}
内容来源于网络,如有侵权,请联系作者删除!