All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.media.update.AssetData Maven / Gradle / Ivy

Go to download

The basic domain classes for 'media', the core of POMS. Also, the 'update' XML bindings for it. It also contains some closely related domain classes like the enum to contain NICAM kijkwijzer settings.

There is a newer version: 8.3.1
Show newest version
/*
 * Copyright (C) 2013 Licensed under the Apache License, Version 2.0
 * VPRO The Netherlands
 */
package nl.vpro.domain.media.update;

import java.io.IOException;
import java.io.InputStream;

import jakarta.activation.DataHandler;
import jakarta.validation.constraints.NotNull;
import jakarta.xml.bind.annotation.*;

/**
 * @author Roelof Jan Koekoek
 * @since 2.1
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "assetDataType", propOrder = {
    "data"
})
public class AssetData implements AssetSource {

    @XmlElement
    @XmlMimeType("application/octet-stream")
    @NotNull(message = "provide asset data")
    private DataHandler data;

    public DataHandler getData() {
        return data;
    }

    public void setData(DataHandler data) {
        this.data = data;
    }

    @Override
    public InputStream getInputStream() {
        try {
            return data.getInputStream();
        } catch(IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String toString() {
        return "AssetData{}";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy