getLogger().error(e.getMessage(), e);
}
}
}
ArtifactInfoResourceResponse result = new ArtifactInfoResourceResponse();
ArtifactInfoResource resource = new ArtifactInfoResource();
resource.setRepositoryId(itemUid.getRepository().getId());
resource.setRepositoryName(itemUid.getRepository().getName());
resource.setRepositoryPath(itemUid.getPath());
resource.setRepositories(createRepositoriesUrl(repositories, req, itemUid.getPath()));
resource.setPresentLocally(fileItem != null);
if (fileItem != null) {
resource.setMd5Hash(fileItem.getRepositoryItemAttributes().get(DigestCalculatingInspector.DIGEST_MD5_KEY));
resource.setSha1Hash(checksum);
resource.setLastChanged(fileItem.getModified());
resource.setSize(fileItem.getLength());
resource.setUploaded(fileItem.getCreated());
resource.setUploader(fileItem.getRepositoryItemAttributes().get(AccessManager.REQUEST_USER));
resource.setMimeType(fileItem.getMimeType());
try {
accessManager.decide(itemUid.getRepository(), request, Action.delete);
resource.setCanDelete(true);
}
catch (AccessDeniedException e) {
resource.setCanDelete(false);
}
}
result.setData(resource);
return result;
}