@Test public void testGet_currentMetadata() throws Exception { String path = "/org/sonatype/nexus/nexus-base/3.19.0-SNAPSHOT/maven-metadata.xml"; Asset asset = createMetadataAsset(path, "valid"); Blob blob = mock(Blob.class); when(blob.getInputStream()) .thenReturn(getClass().getResourceAsStream("/org/sonatype/nexus/repository/maven/gavMetadata.xml")); when(storageTx.findAssetWithProperty(any(), any(), any(Bucket.class))).thenReturn(asset); when(storageTx.requireBlob(any())).thenReturn(blob); MavenPath mavenPath = maven2MavenPathParser.parsePath(path); Content content = underTest.get(mavenPath); assertThat(content, not(nullValue())); assertThat(content.getContentType(), is(TEXT_XML)); verify(storageTx, never()).deleteAsset(any()); verify(metadataRebuilder, never()) .rebuildInTransaction(any(), eq(false), eq(false), eq("org.sonatype.nexus"), eq("nexus-base"), eq("3.19.0-SNAPSHOT")); }
@Nullable @Override public Content get(final MavenPath path) throws IOException { log.debug("GET {} : {}", getRepository().getName(), path.getPath()); return doGet(path); }
MavenFacetImpl extends FacetSupport implements OrientMavenFacet { @Nullable @Override public Content get(final MavenPath path) throws IOException { log.debug("GET {} : {}", getRepository().getName(), path.getPath()); return doGet(path); } }
MavenFacetImpl extends FacetSupport implements OrientMavenFacet { @Nullable @Override public Content get(final MavenPath path) throws IOException { log.debug("GET {} : {}", getRepository().getName(), path.getPath()); return doGet(path); } @Inject  MavenFacetImpl(final Map<String, MavenPathParser> mavenPathParsers,
                        final MavenMetadataContentValidator metadataValidator,
                        @Named("${nexus.maven.metadata.validation.enabled:-true}")
                        final boolean mavenMetadataValidationEnabled,
                        MetadataRebuilder metadataRebuilder); }
MavenFacetImpl extends FacetSupport implements OrientMavenFacet { @Nullable @Override public Content get(final MavenPath path) throws IOException { log.debug("GET {} : {}", getRepository().getName(), path.getPath()); return doGet(path); } @Inject  MavenFacetImpl(final Map<String, MavenPathParser> mavenPathParsers,
                        final MavenMetadataContentValidator metadataValidator,
                        @Named("${nexus.maven.metadata.validation.enabled:-true}")
                        final boolean mavenMetadataValidationEnabled,
                        MetadataRebuilder metadataRebuilder); @Nonnull @Override MavenPathParser getMavenPathParser(); @Nonnull @Override VersionPolicy getVersionPolicy(); @Override LayoutPolicy layoutPolicy(); @Nullable @Override Content get(final MavenPath path); @Override Content put(final MavenPath path, final Payload payload); @Override Content put(final MavenPath path,
                     final Path sourceFile,
                     final String contentType,
                     final AttributesMap contentAttributes,
                     final Map<HashAlgorithm, HashCode> hashes,
                     final long size); @Override Content put(final MavenPath path,
                     final TempBlob blob,
                     final String contentType,
                     final AttributesMap contentAttributes); @TransactionalStoreMetadata Asset put(final MavenPath path, final AssetBlob assetBlob, final AttributesMap contentAttributes); @Override @Transactional boolean exists(final MavenPath path); @Override @TransactionalDeleteBlob Set<String> delete(final MavenPath... paths); @Override @TransactionalDeleteBlob Set<String> maybeDeleteOrFlagToRebuildMetadata(final Bucket bucket, final String groupId, final String artifactId, final String baseVersion); }
MavenFacetImpl extends FacetSupport implements OrientMavenFacet { @Nullable @Override public Content get(final MavenPath path) throws IOException { log.debug("GET {} : {}", getRepository().getName(), path.getPath()); return doGet(path); } @Inject  MavenFacetImpl(final Map<String, MavenPathParser> mavenPathParsers,
                        final MavenMetadataContentValidator metadataValidator,
                        @Named("${nexus.maven.metadata.validation.enabled:-true}")
                        final boolean mavenMetadataValidationEnabled,
                        MetadataRebuilder metadataRebuilder); @Nonnull @Override MavenPathParser getMavenPathParser(); @Nonnull @Override VersionPolicy getVersionPolicy(); @Override LayoutPolicy layoutPolicy(); @Nullable @Override Content get(final MavenPath path); @Override Content put(final MavenPath path, final Payload payload); @Override Content put(final MavenPath path,
                     final Path sourceFile,
                     final String contentType,
                     final AttributesMap contentAttributes,
                     final Map<HashAlgorithm, HashCode> hashes,
                     final long size); @Override Content put(final MavenPath path,
                     final TempBlob blob,
                     final String contentType,
                     final AttributesMap contentAttributes); @TransactionalStoreMetadata Asset put(final MavenPath path, final AssetBlob assetBlob, final AttributesMap contentAttributes); @Override @Transactional boolean exists(final MavenPath path); @Override @TransactionalDeleteBlob Set<String> delete(final MavenPath... paths); @Override @TransactionalDeleteBlob Set<String> maybeDeleteOrFlagToRebuildMetadata(final Bucket bucket, final String groupId, final String artifactId, final String baseVersion);  }