package mircoders.media;
-import mir.media.*;
+import mir.entity.Entity;
+import mir.media.MediaExc;
+import mir.media.MediaFailure;
+import mir.media.MediaHandler;
+import mir.session.UploadedFile;
+
+import java.io.File;
import java.io.InputStream;
-import mir.entity.*;
-import java.util.List;
-import java.util.ArrayList;
/**
* <p>URLMediaHandler</p>
* <p>Description:
- * This is a media handler for media that are only known by url.
+ * This is a media handler for externally stored media.
+ * The media is presented by its url.
* </p>
* @author Zapata
*/
iconAlternative = anIconAlternative;
}
+ /**
+ * {@inheritDoc}
+ *
+ * Since this media handler assumes the media is stored on a wholly different
+ * server, this operation is not applicable
+ */
+ public void store(UploadedFile anUploadedFile, Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Since this media handler assumes the media is stored on a wholly different
+ * server, this operation is not applicable
+ */
public void store(InputStream anInputStream, Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
throw new UnsupportedOperationException();
- };
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * Since this media handler assumes the media is stored on a wholly different
+ * server, this operation is not applicable
+ */
+ public void store(File aFile, Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure {
+ throw new UnsupportedOperationException();
+ }
+ /**
+ * {@inheritDoc}
+ */
public void produce(Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
+ // nothing to do here
}
public InputStream getMedia(Entity anEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
return "application/octetstream";
}
- public List getURL(Entity aMediaEntity, Entity aMediaTypeEntity) throws MediaExc, MediaFailure {
- List result = new ArrayList();
- result.add(aMediaTypeEntity.getFieldValue("publish_server")+aMediaTypeEntity.getFieldValue("publish_path"));
-
- return result;
- }
-
- public Object getURLs(Entity ent, Entity mediaTypeEnt) throws MediaExc, MediaFailure {
- return null;
- }
-
public String getStoragePath () throws MediaExc, MediaFailure {
throw new UnsupportedOperationException();
}
return iconAlternative;
}
- public String getDescr (Entity mediaTypeEnt) {
+ public String getDescr(Entity mediaTypeEnt) {
return "Url";
}
}
\ No newline at end of file