Пример #1
0
  private Artifact storeArtifactMetadata(
      final SoftwareModule softwareModule,
      final String providedFilename,
      final DbArtifact result,
      final Artifact existing) {
    JpaArtifact artifact = (JpaArtifact) existing;
    if (existing == null) {
      artifact = new JpaArtifact(result.getHashes().getSha1(), providedFilename, softwareModule);
    }
    artifact.setMd5Hash(result.getHashes().getMd5());
    artifact.setSha1Hash(result.getHashes().getSha1());
    artifact.setSize(result.getSize());

    LOG.debug("storing new artifact into repository {}", artifact);
    return localArtifactRepository.save(artifact);
  }