com.atlassian.jira.issue.attachment.Attachment.getIssueObject()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中com.atlassian.jira.issue.attachment.Attachment.getIssueObject()方法的一些代码示例,展示了Attachment.getIssueObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attachment.getIssueObject()方法的具体详情如下:
包路径:com.atlassian.jira.issue.attachment.Attachment
类名称:Attachment
方法名:getIssueObject

Attachment.getIssueObject介绍

[英]Returns the Issue that this file is attached to. Legacy synonym for #getIssue().
[中]返回此文件附加到的问题。#getIssue()的传统同义词。

代码示例

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public boolean isThumbnailable(final Attachment attachment)
{
  return isThumbnailable(attachment.getIssueObject(), attachment);
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public Thumbnail getThumbnail(final Attachment attachment)
{
  return getThumbnail(attachment.getIssueObject(), attachment);
}

代码示例来源:origin: com.atlassian.jira/jira-api

/**
 * Returns the physical File for the given Attachment.
 * If you are calling this on multiple attachments for the same issue, consider using the overriden method that
 * passes in the issue.  Else, this goes to the database for each call.
 *
 * @param attachment the attachment.
 * @return the file.
 * @throws DataAccessException on failure getting required attachment info.
 */
public static File getAttachmentFile(Attachment attachment) throws DataAccessException
{
  return getAttachmentFile(attachment.getIssueObject(), attachment);
}

代码示例来源:origin: com.atlassian.jira/jira-attachment-dmz

public static AttachmentKey from(final Attachment attachment)
{
  return from(attachment, attachment.getIssueObject());
}

代码示例来源: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-core

@Nonnull
@Override
public File getThumbnailFile(@Nonnull final Attachment attachment)
{
  final AttachmentStore.AttachmentAdapter attachmentAdapter = AttachmentAdapterImpl.fromAttachment(attachment);
  final File thumbDir = getAttachmentDirectoryAccessor().getThumbnailDirectory(attachment.getIssueObject());
  return getThumbnailFile(attachmentAdapter, thumbDir);
}

代码示例来源:origin: com.atlassian.jira/jira-core

/**
 * Returns the old legacy file name for thumbnails
 *
 * http://jira.atlassian.com/browse/JRA-23311
 *
 * @param  attachment the attacment in play
 * @return the full legacy thumbnail file name
 */
@Override
public File getLegacyThumbnailFile(@Nonnull final Attachment attachment)
{
  final AttachmentStore.AttachmentAdapter attachmentAdapter = AttachmentAdapterImpl.fromAttachment(attachment);
  final File thumbDir = getAttachmentDirectoryAccessor().getThumbnailDirectory(attachment.getIssueObject());
  return getLegacyThumbnailFile(attachmentAdapter, thumbDir);
}

代码示例来源:origin: com.atlassian.streams/streams-jira-plugin

@Override
  public ActivityObject apply(Attachment attachment) {
    final StreamsUriBuilder idBuilder = new StreamsUriBuilder().setUrl(issueUriBuilder.getIssueUri(baseUri, attachment.getIssueObject()).toASCIIString()).setTimestamp(attachment.getCreated());
    return new ActivityObject(ActivityObject.params().
        id(idBuilder.getUri().toASCIIString()).
        activityObjectType(file()).
        title(some(attachment.getFilename())).
        alternateLinkUri(issueUriBuilder.getAttachmentUri(baseUri, attachment)));
  }
};

代码示例来源:origin: com.atlassian.jira/jira-core

/**
   * Checks if the given user had permission to see the attachemnt.
   *
   * @param username   username of the user who wants to see the attachment
   * @param attachment attachment to be checked
   * @return true if user can see the attachment, false otherwise
   * @throws DataAccessException if no such user exists.
   */
  protected boolean hasPermissionToViewAttachment(String username, Attachment attachment) throws DataAccessException
  {
    Issue issue = attachment.getIssueObject();
    if (username == null)
    {
      return (ComponentAccessor.getPermissionManager().hasPermission(BROWSE, issue, (ApplicationUser) null));
    }
    final ApplicationUser user = ComponentAccessor.getUserManager().getUserByName(username);
    if (user == null)
    {
      throw new DataAccessException("User '"+ username + "' not found");
    }
    return (ComponentAccessor.getPermissionManager().hasPermission(BROWSE, issue, user));
  }
}

代码示例来源:origin: com.atlassian.jira/jira-api

bean.content = String.format("%s/secure/attachment/%s/%s", urls.baseUrl(), attachment.getId(), encodedFilename);
ThumbnailedImage thumbnail = thumbnailManager.toThumbnailedImage(thumbnailManager.getThumbnail(attachment.getIssueObject(), attachment));
if (thumbnail != null)

代码示例来源:origin: com.atlassian.jira/jira-core

bean.setContent(String.format("%s/secure/attachment/%s/%s", urls.baseUrl(), attachment.getId(), encodedFilename));
ThumbnailedImage thumbnail = thumbnailManager.toThumbnailedImage(thumbnailManager.getThumbnail(attachment.getIssueObject(), attachment));
if (thumbnail != null)

相关文章