Search in sources :

Example 1 with AttributesMap

use of org.sonatype.nexus.common.collect.AttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class HostedHandlersTest method passAttributesWithoutMatcherTo.

private void passAttributesWithoutMatcherTo(final Handler handler) throws Exception {
    when(context.getAttributes()).thenReturn(new AttributesMap());
    handler.handle(context);
}
Also used : AttributesMap(org.sonatype.nexus.common.collect.AttributesMap)

Example 2 with AttributesMap

use of org.sonatype.nexus.common.collect.AttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class HostedHandlersTest method initialiseTestFixtures.

private void initialiseTestFixtures() {
    attributesMap = new AttributesMap();
    tokens = new HashMap<>();
    state = new TestState(tokens);
    attributesMap.set(State.class, state);
}
Also used : AttributesMap(org.sonatype.nexus.common.collect.AttributesMap)

Example 3 with AttributesMap

use of org.sonatype.nexus.common.collect.AttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class HostedHandlersTest method initialiseTestFixtures.

private void initialiseTestFixtures() {
    attributesMap = new AttributesMap();
    tokens = new HashMap<>();
    state = new TestState(tokens);
    attributesMap.set(State.class, state);
}
Also used : AttributesMap(org.sonatype.nexus.common.collect.AttributesMap)

Example 4 with AttributesMap

use of org.sonatype.nexus.common.collect.AttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class RFacetUtils method saveAsset.

/**
 * Save an asset && create blob.
 *
 * @return blob content
 */
static Content saveAsset(final StorageTx tx, final Asset asset, final Supplier<InputStream> contentSupplier, final Payload payload) throws IOException {
    AttributesMap contentAttributes = null;
    String contentType = null;
    if (payload instanceof Content) {
        contentAttributes = ((Content) payload).getAttributes();
        contentType = payload.getContentType();
    }
    return saveAsset(tx, asset, contentSupplier, contentType, contentAttributes);
}
Also used : Content(org.sonatype.nexus.repository.view.Content) AttributesMap(org.sonatype.nexus.common.collect.AttributesMap)

Example 5 with AttributesMap

use of org.sonatype.nexus.common.collect.AttributesMap in project nexus-repository-r by sonatype-nexus-community.

the class RFacetUtils method saveAsset.

/**
 * Save an asset && create blob.
 *
 * @return blob content
 */
public static Content saveAsset(final StorageTx tx, final Asset asset, final Supplier<InputStream> contentSupplier, final Payload payload) throws IOException {
    AttributesMap contentAttributes = null;
    String contentType = null;
    if (payload instanceof Content) {
        contentAttributes = ((Content) payload).getAttributes();
        contentType = payload.getContentType();
    }
    return saveAsset(tx, asset, contentSupplier, contentType, contentAttributes);
}
Also used : Content(org.sonatype.nexus.repository.view.Content) AttributesMap(org.sonatype.nexus.common.collect.AttributesMap)

Aggregations

AttributesMap (org.sonatype.nexus.common.collect.AttributesMap)6 Content (org.sonatype.nexus.repository.view.Content)2 InputStream (java.io.InputStream)1 RFacet (org.sonatype.nexus.repository.r.RFacet)1 Asset (org.sonatype.nexus.repository.storage.Asset)1 Component (org.sonatype.nexus.repository.storage.Component)1 StorageTx (org.sonatype.nexus.repository.storage.StorageTx)1 TransactionalTouchBlob (org.sonatype.nexus.repository.transaction.TransactionalTouchBlob)1