private Gav getReleaseGav( String s, int vEndPos, String groupId, String artifactId, String version, String fileName, boolean checksum, boolean signature, Gav.HashType checksumType, Gav.SignatureType signatureType ) { if ( !fileName.startsWith( artifactId + "-" + version + "." ) && !fileName.startsWith( artifactId + "-" + version + "-" ) ) { // The path does not represents an artifact (filename does not match artifactId-version)! return null; } int nTailPos = vEndPos + artifactId.length() + version.length() + 2; String tail = s.substring( nTailPos ); int nExtPos = tail.indexOf( '.' ); if ( nExtPos == -1 ) { // NX-563: not allowing extensionless paths to be interpreted as artifact return null; } String ext = tail.substring( nExtPos + 1 ); String classifier = tail.charAt( 0 ) == '-' ? tail.substring( 1, nExtPos ) : null; return new Gav( groupId, artifactId, version, classifier, ext, null, null, fileName, checksum, checksumType, signature, signatureType ); }
return new Gav( groupId, artifactId, version, classifier, ext, snapshotBuildNo, snapshotTimestamp, fileName, checksum, checksumType, signature, signatureType );
new Gav(artifactInfo.groupId, artifactInfo.artifactId, artifactInfo.version, artifactInfo.classifier, mr.getArtifactPackagingMapper().getExtensionForPackaging( artifactInfo.packaging), null, null, null, false, null, false, null);
new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), RepositoryPolicy.SNAPSHOT.equals( repository.getRepositoryPolicy() ) ? "1-SNAPSHOT" : "1", gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null ); new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), RepositoryPolicy.SNAPSHOT.equals( repository.getRepositoryPolicy() ) ? "1-SNAPSHOT" : "1", gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null ); new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), version, gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null );
public void deleteArtifact( ArtifactStoreRequest gavRequest, boolean withChecksums, boolean withAllSubordinates, boolean deleteWholeGav ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { // delete the artifact Gav gav = new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null ); gavRequest.setRequestPath( repository.getGavCalculator().gavToPath( gav ) ); handleDelete( gavRequest, deleteWholeGav, withChecksums, withAllSubordinates ); }
.gavToPath(new Gav(groupId, artifactId, version.toString())); final String vDirectory = PathUtils.getParentPath(gavPath); try {
public void storeArtifact( ArtifactStoreRequest gavRequest, InputStream is, Map<String, String> attributes ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { checkRequest( gavRequest ); Gav gav = new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null ); gavRequest.setRequestPath( repository.getGavCalculator().gavToPath( gav ) ); repository.storeItemWithChecksums( gavRequest, is, attributes ); }
public void deleteArtifactPom( ArtifactStoreRequest gavRequest, boolean withChecksums, boolean withAllSubordinates, boolean deleteWholeGav ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { // This is just so we can get teh gavToPath functionallity, to give us a path to work with Gav gav = new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), "pom", null, null, null, false, null, false, null ); gavRequest.setRequestPath( repository.getGavCalculator().gavToPath( gav ) ); /* * // First undeploy, we will read the pom contents to build the gav try { gav = new Gav( * gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), * getPackagingFromPom( gavRequest.getRequestPath() ), null, null, null, RepositoryPolicy.SNAPSHOT.equals( * repository.getRepositoryPolicy() ), false, null, false, null ); } catch ( IOException e ) { throw new * StorageException( "Could not read pom file!", e ); } catch ( XmlPullParserException e ) { throw new * StorageException( "Could not read pom file!", e ); } gavRequest.setRequestPath( * repository.getGavCalculator().gavToPath( gav ) ); // delete the pom's artifact handleDelete( gavRequest, * deleteWholeGav, withChecksums, withAllSubordinates ); // Now delete the pom gav = new Gav( * gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest .getClassifier(), * "pom", null, null, null, RepositoryPolicy.SNAPSHOT.equals( repository .getRepositoryPolicy() ), false, null, * false, null ); gavRequest.setRequestPath( repository.getGavCalculator().gavToPath( gav ) ); */ handleDelete( gavRequest, deleteWholeGav, withChecksums, withAllSubordinates ); }
Gav gav = new Gav(g, a, v, c, e, null, null, null, false, null, false, null);
protected Gav getPomGav( ArtifactStoreRequest request ) { Gav pomGav = new Gav( request.getGav().getGroupId(), // groupId request.getGav().getArtifactId(), // artifactId request.getGav().getVersion(), // version null, // classifier "pom", // extension request.getGav().getSnapshotBuildNumber(), // snapshotBuildNumber request.getGav().getSnapshotTimeStamp(), // snapshotTimeStamp null, // name false, // hash null, // hashType false, // signature null // signatureType ); return pomGav; }
new Gav( snapshotGav.getGroupId(), snapshotGav.getArtifactId(), releaseVersion, snapshotGav.getClassifier(), snapshotGav.getExtension(), null, null, null, false, null, false, null );
new Gav( gav.getGroupId(), gav.getArtifactId(), latest, gav.getClassifier(), gav.getExtension(), buildNo, buildTs, gav.getName(), gav.isHash(), gav.getHashType(), gav.isSignature(), gav.getSignatureType() );
public void storeArtifactPom( ArtifactStoreRequest gavRequest, InputStream is, Map<String, String> attributes ) throws UnsupportedStorageOperationException, IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { checkRequest( gavRequest ); Gav gav = new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), "pom", null, null, null, false, null, false, null ); gavRequest.setRequestPath( repository.getGavCalculator().gavToPath( gav ) ); repository.storeItemWithChecksums( gavRequest, is, attributes ); try { repository.getMetadataManager().deployArtifact( gavRequest ); } catch ( IOException e ) { throw new LocalStorageException( "Could not maintain metadata!", e ); } }
new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), null, "pom", null, null, null, false, null, false, null ); new Gav( gavRequest.getGroupId(), gavRequest.getArtifactId(), gavRequest.getVersion(), gavRequest.getClassifier(), gavRequest.getExtension(), null, null, null, false, null, false, null );
new Gav(ai.groupId, ai.artifactId, ai.version, ai.classifier, mavenRepository.getArtifactPackagingMapper().getExtensionForPackaging(ai.packaging), null, null, null, false, null, false, null);
public StorageFileItem retrieveArtifactPom( ArtifactStoreRequest gavRequest ) throws IllegalOperationException, ItemNotFoundException, StorageException, AccessDeniedException { Gav pomGav = new Gav( gavRequest.getGav().getGroupId(), gavRequest.getGav().getArtifactId(), gavRequest.getGav().getVersion(), null, // gavRequest.getGav().getClassifier(), "pom", // gavRequest.getGav().getExtension(), gavRequest.getGav().getSnapshotBuildNumber(), gavRequest.getGav().getSnapshotTimeStamp(), gavRequest.getGav().getName(), gavRequest.getGav().isHash(), gavRequest.getGav().getHashType(), gavRequest.getGav().isSignature(), gavRequest.getGav().getSignatureType() ); ArtifactStoreRequest pomRequest = new ArtifactStoreRequest( gavRequest.getMavenRepository(), pomGav, gavRequest.isRequestLocalOnly(), gavRequest.isRequestRemoteOnly() ); return retrieveArtifact( pomRequest ); }
protected Gav resolveSnapshotFromM3Metadata( final ArtifactStoreRequest gavRequest, final Gav gav, final Metadata gavMd ) throws IOException { for ( SnapshotVersion sv : gavMd.getVersioning().getSnapshotVersions() ) { if ( StringUtils.equals( sv.getExtension(), gav.getExtension() ) && StringUtils.equals( StringUtils.defaultString( sv.getClassifier(), "" ), StringUtils.defaultString( gav.getClassifier(), "" ) ) ) { Long buildTs = getTimeFromMetadataTimestampMaven3Updated( sv.getUpdated() ); Integer buildNo = getBuildNumberForMetadataMaven3Value( sv.getVersion() ); return new Gav( gav.getGroupId(), gav.getArtifactId(), sv.getVersion(), gav.getClassifier(), gav.getExtension(), buildNo, buildTs, gav.getName(), gav.isHash(), gav.getHashType(), gav.isSignature(), gav.getSignatureType() ); } } // even if model version is 1.1.0, we have no snapshots versions? return resolveSnapshotFromM2Metadata( gavRequest, gav, gavMd ); }
Gav gav = new Gav( g, a, v, c, e, null, null, null, false, null, false, null );