nl.vpro.domain.media.update.AssetData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of media-domain Show documentation
Show all versions of media-domain Show documentation
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.
/*
* 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{}";
}
}