public LuceneRepositoryContentRecord convert( Document document ) throws ParseException { FileContentRecord record = new FileContentRecord(); 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 ); if( StringUtils.isNotBlank( groupId ) && StringUtils.isNotBlank( artifactId ) ) { ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); record.setArtifact( artifact ); } // Filecontent Specifics record.setFilename( document.get( FileContentKeys.FILENAME ) ); record.setContents( document.get( FileContentKeys.CONTENT ) ); return record; }
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; } }
public LuceneRepositoryContentRecord convert( Document document ) throws ParseException { BytecodeRecord record = new BytecodeRecord(); 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 ); // Bytecode Specifics JavaArtifactHelper.getJavaDetails( record.getArtifact() ).setJdk( document.get( BytecodeKeys.JDK ) ); record.setClasses( getList( document, BytecodeKeys.CLASSES ) ); record.setMethods( getList( document, BytecodeKeys.METHODS ) ); record.setFiles( getList( document, BytecodeKeys.FILES ) ); return record; }
ArchivaArtifact artifact = new ArchivaArtifact( ref ); record.setArtifact( artifact );