com.atlassian.jira.project.Project.getOriginalKey()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(158)

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

Project.getOriginalKey介绍

暂无

代码示例

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

public Keys(final Issue issue)
  {
    issueKey = issue.getKey();
    projectKey = issue.getProjectObject().getOriginalKey();
  }
}

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

public static AttachmentKey from(final Project project, final Issue issue, final Attachment attachment)
{
  return from(project.getOriginalKey(), issue.getKey(), attachment);
}

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

/**
 * Get the attachment directory for the given attachment base directory, project key, and issue key.
 * <p/>
 * The idea is to encapsulate all of the path-joinery magic to make future refactoring easier if we ever decide to
 * move away from attachment-base/project-key/issue-ket
 *
 * @param attachmentDirectory base of attachments
 * @param projectKey the project key the issue belongs to
 * @param issueKey the issue key for the issue
 * @return the directory attachments for this issue live in
 */
@Override
public File getAttachmentDirectory(final String attachmentDirectory, final String projectKey, final String issueKey)
{
  final Project project = projectManager.getProjectObjByKey(projectKey);
  final String projectOriginalKey;
  if (project == null)
  {
    // looking for attachments in standard directory when project does not exist e.g. we are importing project and validating attachments
    projectOriginalKey = projectKey;
  }
  else
  {
    //handle renamed projects by always putting attachments in original directory
    projectOriginalKey = project.getOriginalKey();
  }
  return FileAttachments.getAttachmentDirectoryForIssue(new File(attachmentDirectory), projectOriginalKey, issueKey);
}

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

@Override
@Nullable
public File getAttachmentDirectory(@Nonnull final String issueKey)
{
  final IssueKey ik = IssueKey.from(issueKey);
  final Project project = projectManager.getProjectObjByKey(ik.getProjectKey());
  if (project != null)
  {
    return getAttachmentDirectory(getAttachmentDirName(), project.getOriginalKey(),
        IssueKey.format(project.getOriginalKey(), ik.getIssueNumber()));
  }
  return null;
}

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

private AttachmentKey createAttachmentKey(final String filename, final Issue issue)
{
  final Long attachmentId = attachmentIdSequencer.getNextId();
  return AttachmentKey.builder()
      .withAttachmentFilename(filename)
      .withIssueKey(issue.getKey())
      .withAttachmentId(attachmentId)
      .withProjectKey(issue.getProjectObject().getOriginalKey())
      .build();
}

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

@Override
public Promise<Void> move(final Attachment metaData, final String newIssueKey)
{
  final AttachmentKey oldAttachmentKey = attachmentKeyMapper.fromAttachment(metaData);
  final IssueKey ik = IssueKey.from(newIssueKey);
  final Project project = projectManager.getProjectObjByKey(ik.getProjectKey());
  final String originalProjectKey = project.getOriginalKey();
  final AttachmentKey newAttachmentKey = AttachmentKeys.from(
      originalProjectKey,
      newIssueKey,
      oldAttachmentKey.getAttachmentFilename(),
      oldAttachmentKey.getAttachmentId());
  return moveAttachment(oldAttachmentKey, newAttachmentKey).map(unitToVoid());
}

代码示例来源: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();
}

相关文章