1.1 restoration
[mir.git] / source / mircoders / media / URLMediaHandler.java
index 6603d1c..8401074 100755 (executable)
@@ -1,15 +1,19 @@
 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
  */
@@ -25,11 +29,41 @@ public class URLMediaHandler implements MediaHandler {
     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 {
@@ -44,17 +78,6 @@ public class URLMediaHandler implements MediaHandler {
     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();
   }
@@ -79,7 +102,7 @@ public class URLMediaHandler implements MediaHandler {
     return iconAlternative;
   }
 
-  public String getDescr (Entity mediaTypeEnt) {
+  public String getDescr(Entity mediaTypeEnt) {
     return "Url";
   }
 }
\ No newline at end of file