protected void writeGMetadata( ArtifactStoreRequest request, Gav gav, Metadata md ) throws UnsupportedStorageOperationException, IllegalOperationException, MetadataException, IOException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // G mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); writeMetadata( uid, request.getRequestContext(), md ); }
protected void writeGAMetadata( ArtifactStoreRequest request, Gav gav, Metadata md ) throws UnsupportedStorageOperationException, IllegalOperationException, MetadataException, IOException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); writeMetadata( uid, request.getRequestContext(), md ); }
@Override public String toString() { StringBuilder sb = new StringBuilder( super.toString() ); sb.append( "(GAVCE=" ); sb.append( getGroupId() ); sb.append( ":" ); sb.append( getArtifactId() ); sb.append( ":" ); sb.append( getVersion() ); sb.append( ":c=" ); sb.append( getClassifier() ); sb.append( ":e=" ); sb.append( getExtension() ); sb.append( ", for " ); sb.append( RepositoryStringUtils.getHumanizedNameString( getMavenRepository() ) ); sb.append( ") " ); return sb.toString(); }
protected void writeGAVMetadata( ArtifactStoreRequest request, Gav gav, Metadata md ) throws UnsupportedStorageOperationException, IllegalOperationException, MetadataException, IOException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); writeMetadata( uid, request.getRequestContext(), md ); }
protected Metadata readOrCreateGMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // G mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( null ); result.setArtifactId( null ); result.setVersion( null ); return result; }
@Override public Gav resolveSnapshot( ArtifactStoreRequest request, Gav gav ) throws IOException { if ( getRepository() != request.getMavenRepository() ) { throw new IllegalArgumentException( "This is MavenRepositoryMetadataManager of repository " + RepositoryStringUtils.getHumanizedNameString( getRepository() ) + " while the request refers to " + RepositoryStringUtils.getHumanizedNameString( request.getMavenRepository() ) + "!" ); } return getRepository().getMetadataManager().resolveSnapshot( request, gav ); } }
@Override public void deployArtifact( ArtifactStoreRequest request ) throws IOException { if ( getRepository() != request.getMavenRepository() ) { throw new IllegalArgumentException( "This is MavenRepositoryMetadataManager of repository " + RepositoryStringUtils.getHumanizedNameString( getRepository() ) + " while the request refers to " + RepositoryStringUtils.getHumanizedNameString( request.getMavenRepository() ) + "!" ); } getRepository().getMetadataManager().deployArtifact( request ); }
@Override public void undeployArtifact( ArtifactStoreRequest request ) throws IOException { if ( getRepository() != request.getMavenRepository() ) { throw new IllegalArgumentException( "This is MavenRepositoryMetadataManager of repository " + RepositoryStringUtils.getHumanizedNameString( getRepository() ) + " while the request refers to " + RepositoryStringUtils.getHumanizedNameString( request.getMavenRepository() ) + "!" ); } getRepository().getMetadataManager().undeployArtifact( request ); }
@Override public Gav resolveArtifact( ArtifactStoreRequest request ) throws IOException { if ( getRepository() != request.getMavenRepository() ) { throw new IllegalArgumentException( "This is MavenRepositoryMetadataManager of repository " + RepositoryStringUtils.getHumanizedNameString( getRepository() ) + " while the request refers to " + RepositoryStringUtils.getHumanizedNameString( request.getMavenRepository() ) + "!" ); } return getRepository().getMetadataManager().resolveArtifact( request ); }
protected Metadata readOrCreateGAMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ); // GA mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( gav.getGroupId() ); result.setArtifactId( gav.getArtifactId() ); result.setVersion( null ); return result; }
protected Metadata readOrCreateGAVMetadata( ArtifactStoreRequest request, Gav gav ) throws IllegalOperationException, IOException, MetadataException { String mdPath = request.getRequestPath(); // GAV mdPath = mdPath.substring( 0, mdPath.lastIndexOf( RepositoryItemUid.PATH_SEPARATOR ) ) + "/maven-metadata.xml"; RepositoryItemUid uid = request.getMavenRepository().createUid( mdPath ); Metadata result = readOrCreateMetadata( uid, request ); result.setGroupId( gav.getGroupId() ); result.setArtifactId( gav.getArtifactId() ); result.setVersion( gav.getBaseVersion() ); return result; }
GavCalculator gavCalculator = request.getMavenRepository().getGavCalculator(); StorageFileItem pomFile = (StorageFileItem) request.getMavenRepository().retrieveItem( false, request );
String pomPath = request.getMavenRepository().getGavCalculator().gavToPath( gav ); StorageFileItem pomFile = (StorageFileItem) request.getMavenRepository().retrieveItem( false, request );
protected String resolveLatest( ArtifactStoreRequest gavRequest, Gav gav ) throws IOException MavenRepository repository = gavRequest.getMavenRepository(); metadataLocator.retrieveGAMetadata( new ArtifactStoreRequest( gavRequest.getMavenRepository(), gav, gavRequest.isRequestLocalOnly(), gavRequest.isRequestRemoteOnly() ) );
protected String resolveRelease( ArtifactStoreRequest gavRequest, Gav gav ) throws IOException MavenRepository repository = gavRequest.getMavenRepository(); metadataLocator.retrieveGAMetadata( new ArtifactStoreRequest( gavRequest.getMavenRepository(), gav, gavRequest.isRequestLocalOnly(), gavRequest.isRequestRemoteOnly() ) );
throws IOException MavenRepository repository = gavRequest.getMavenRepository(); metadataLocator.retrieveGAVMetadata( new ArtifactStoreRequest( gavRequest.getMavenRepository(), gav, gavRequest.isRequestLocalOnly(), gavRequest.isRequestRemoteOnly() ) );
MavenRepository mr = gavRequest.getMavenRepository();
throws IOException MavenRepository repository = gavRequest.getMavenRepository();
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 ); }
final MavenRepository mr = gavRequest.getMavenRepository(); final ArtifactStoreHelper helper = mr.getArtifactStoreHelper();