1 package mircoders.media;
4 import java.io.InputStream;
7 import java.util.ArrayList;
10 * <p>URLMediaHandler</p>
12 * This is a media handler for media that are only known by url.
17 public class URLMediaHandler implements MediaHandler {
18 private String bigIcon;
19 private String tinyIcon;
20 private String iconAlternative;
22 public URLMediaHandler(String aBigIcon, String aTinyIcon, String anIconAlternative) {
25 iconAlternative = anIconAlternative;
28 public void store(InputStream anInputStream, Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
29 throw new UnsupportedOperationException();
32 public void produce(Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
35 public InputStream getMedia(Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
39 public InputStream getThumbnail(Entity anEntity) throws MediaExc, MediaFailure {
43 public String getThumbnailMimeType(Entity aMediaEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
44 return "application/octetstream";
47 public List getURL(Entity aMediaEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
48 List result = new ArrayList();
49 result.add(aMediaTypeEntity.getValue("publish_server")+aMediaTypeEntity.getValue("publish_path"));
54 public Object getURLs(Entity ent, Entity mediaTypeEnt) throws MediaExc, MediaFailure {
58 public String getStoragePath () throws MediaExc, MediaFailure {
59 throw new UnsupportedOperationException();
62 public String getIconStoragePath () throws MediaExc, MediaFailure {
63 throw new UnsupportedOperationException();
66 public String getPublishHost () throws MediaExc, MediaFailure {
67 throw new UnsupportedOperationException();
70 public String getBigIconName () {
74 public String getTinyIconName () {
78 public String getIconAltName () {
79 return iconAlternative;
82 public String getDescr (Entity mediaTypeEnt) {