public LuceneRepositoryContentRecord convert( Document document ) throws ParseException { HashcodesRecord record = new HashcodesRecord(); record.setRepositoryId( document.get( LuceneDocumentMaker.REPOSITORY_ID ) ); // Artifact Reference String groupId = document.get( ArtifactKeys.GROUPID ); String artifactId = document.get( ArtifactKeys.ARTIFACTID ); String version = document.get( ArtifactKeys.VERSION ); String classifier = document.get( ArtifactKeys.CLASSIFIER ); String type = document.get( ArtifactKeys.TYPE ); ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); record.setArtifact( artifact ); // Hashcode Specifics record.getArtifact().getModel().setChecksumMD5( document.get( HashcodesKeys.MD5 ) ); record.getArtifact().getModel().setChecksumSHA1( document.get( HashcodesKeys.SHA1 ) ); return record; } }
try artifact.getModel().setChecksumMD5( digestMd5.calc( artifactFile ) );
try artifact.getModel().setChecksumMD5( digestMd5.calc( artifactFile ) );