本文整理了Java中com.atlassian.jira.issue.attachment.Attachment.getFilesize()
方法的一些代码示例,展示了Attachment.getFilesize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attachment.getFilesize()
方法的具体详情如下:
包路径:com.atlassian.jira.issue.attachment.Attachment
类名称:Attachment
方法名:getFilesize
暂无
代码示例来源:origin: com.atlassian.jira.plugins/jira-healthcheck-plugin
@Override
public Boolean withInputStream(InputStream inputStream) throws IOException
{
return inputStream != null && inputStream.available() == attachment.getFilesize();
}
});
代码示例来源:origin: com.atlassian.jira/jira-attachment-dmz
public static File validateFileForAttachment(final Attachment metaData, final File file)
{
Preconditions.checkArgument(file.exists() && file.isFile() && file.canRead(), "Source file is unavailable");
Preconditions.checkArgument(file.length() == metaData.getFilesize(),
"Source file has different length to what is store in Attachment metadata. Expected %s, but is %s.", metaData.getFilesize(), file.length());
return file;
}
代码示例来源:origin: com.atlassian.jira/jira-core
/**
* Sets the content type, content length and "Content-Disposition" header
* of the response based on the values of the attachement found.
*
* @param request HTTP request
* @param response HTTP response
* @throws AttachmentNotFoundException
* @throws IOException
*/
protected void setResponseHeaders(HttpServletRequest request, HttpServletResponse response)
throws AttachmentNotFoundException, IOException
{
final Attachment attachment = getAttachment(attachmentQuery(request));
response.setContentType(attachment.getMimetype());
response.setContentLength(attachment.getFilesize().intValue());
getMimeSniffingKit().setAttachmentResponseHeaders(attachment, request.getHeader(USER_AGENT_HEADER), response);
HttpResponseHeaders.cachePrivatelyForAboutOneYear(response);
}
代码示例来源: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
UserBean author = new UserBeanBuilder(jiraBaseUrls, jiraAvatarSupport).user(attachment.getAuthorObject()).buildShort();
Timestamp created = attachment.getCreated();
Long size = attachment.getFilesize();
String mimeType = attachment.getMimetype();
HashMap<String, Object> properties = new PropertySetAdapter().marshal(attachment.getProperties());
代码示例来源:origin: com.atlassian.jira/jira-api
bean.id = attachment.getId().toString();
bean.filename = attachment.getFilename();
bean.size = FileSize.format(attachment.getFilesize());
bean.mimeType = attachment.getMimetype();
bean.author = ComponentAccessor.getComponent(UserBeanFactory.class).createBean(attachment.getAuthorObject(), loggedInUser, urls, emailFormatter, ComponentAccessor.getComponent(TimeZoneManager.class));
代码示例来源:origin: com.atlassian.jira/jira-core
bean.setId(attachment.getId().toString());
bean.setFilename(attachment.getFilename());
bean.setSize(attachment.getFilesize());
bean.setMimeType(attachment.getMimetype());
ApplicationUser author = attachment.getAuthorObject();
代码示例来源: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();
}
代码示例来源:origin: com.atlassian.jira/jira-core
author != null ? author.getDisplayName() : null,
attachment.getAuthorKey(),
FileSize.format(attachment.getFilesize()),
attachment.getFilename(),
attachment.getMimetype(),
内容来源于网络,如有侵权,请联系作者删除!