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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations