cleanup / abuse system fix / prepping for a release
[mir.git] / source / mir / session / UploadedFile.java
index 731fcee..58eac87 100755 (executable)
  */
 package mir.session;
 
+import java.io.File;
 import java.io.InputStream;
+import java.io.OutputStream;
 
 public interface UploadedFile {
-  InputStream getInputStream() throws SessionExc, SessionFailure;
-  String getFileName();
-  String getFieldName();
-  String getContentType();
+  /**
+   * Writes the uploaded content to a file
+   */
+  public void writeToFile(File aFile) throws SessionExc, SessionFailure;
+
+  /**
+   * Writes the uploaded content to a file
+   */
+  public void writeToStream(OutputStream aStream) throws SessionExc, SessionFailure;
+
+  /**
+   * Creates an <code>InputStream</code> to access the uploaded content  
+   */
+  public InputStream getInputStream() throws SessionExc, SessionFailure;
+
+  /**
+   * Return the filename supplied by the uploader if available.
+   * <code>null</code> if no filename is available.
+   */
+  public String getFileName();
+
+  /**
+   * Return the field name associated with the uploaded file
+   */
+  public String getFieldName();
+
+  /**
+   * Return the content type (if it's present) of the uploaded file.
+   * <code>null</code> if no content type is available. 
+   */
+  public String getContentType();
 }
\ No newline at end of file