use of com.xabber.android.data.extension.references.RefFile in project xabber-android by redsolution.
the class HttpFileUploadManager method refMediaToAttachment.
private static Attachment refMediaToAttachment(RefMedia media) {
Attachment attachment = new Attachment();
attachment.setFileUrl(media.getUri());
attachment.setIsImage(FileManager.isImageUrl(media.getUri()));
RefFile file = media.getFile();
if (file != null) {
attachment.setTitle(file.getName());
attachment.setMimeType(file.getMediaType());
attachment.setDuration(file.getDuration());
attachment.setFileSize(file.getSize());
if (file.getHeight() > 0)
attachment.setImageHeight(file.getHeight());
if (file.getWidth() > 0)
attachment.setImageWidth(file.getWidth());
}
return attachment;
}
Aggregations