Search in sources :

Example 11 with BinaryAttachment

use of com.enonic.xp.node.BinaryAttachment in project xp by enonic.

the class BinaryAttachmentsParser method handleValue.

private void handleValue(final Object value) {
    if (value instanceof BinaryAttachment) {
        final BinaryAttachment binaryAttachment = (BinaryAttachment) value;
        this.binaryAttachmentsBuilder.add(new BinaryAttachment(binaryAttachment.getReference(), binaryAttachment.getByteSource()));
    }
}
Also used : BinaryAttachment(com.enonic.xp.node.BinaryAttachment)

Aggregations

BinaryAttachment (com.enonic.xp.node.BinaryAttachment)11 Test (org.junit.jupiter.api.Test)5 PropertyTree (com.enonic.xp.data.PropertyTree)4 BinaryReference (com.enonic.xp.util.BinaryReference)4 ByteSource (com.google.common.io.ByteSource)4 UpdateRepositoryParams (com.enonic.xp.repository.UpdateRepositoryParams)3 AttachedBinaries (com.enonic.xp.node.AttachedBinaries)2 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)2 AbstractNodeTest (com.enonic.xp.repo.impl.node.AbstractNodeTest)2 EditableRepository (com.enonic.xp.repository.EditableRepository)2 Repository (com.enonic.xp.repository.Repository)2 RepositoryId (com.enonic.xp.repository.RepositoryId)2 Application (com.enonic.xp.app.Application)1 Branch (com.enonic.xp.branch.Branch)1 ContentInheritType (com.enonic.xp.content.ContentInheritType)1 ContentPath (com.enonic.xp.content.ContentPath)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 Property (com.enonic.xp.data.Property)1