Package org.sonatype.nexus.rest.model

Examples of org.sonatype.nexus.rest.model.ArtifactInfoResourceResponse


      RequestFacade.releaseResponse(response);
    }

    XStreamRepresentation rep =
        new XStreamRepresentation(XStreamFactory.getXmlXStream(), entityText, MediaType.APPLICATION_XML);
    ArtifactInfoResourceResponse info =
        (ArtifactInfoResourceResponse) rep.getPayload(new ArtifactInfoResourceResponse());

    return info.getData();
  }
View Full Code Here


          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;
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.rest.model.ArtifactInfoResourceResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.