001 package org.tynamo.descriptor.extension;
002
003 import java.io.Serializable;
004
005 /**
006 * Represents an uploaded file.
007 * It's kind of a Tynamo clone of {@link org.apache.tapestry.request.IUploadFile}
008 *
009 */
010 public interface TynamoBlob extends Serializable
011 {
012
013 /**
014 * @return the name of the file that was uploaded. This is just the filename portion of the complete path.
015 */
016 String getFileName();
017
018 void setFileName(String fileName);
019
020 /**
021 * @return the complete path, as reported by the client browser. Different browsers report different things here.
022 */
023 String getFilePath();
024
025 void setFilePath(String filePath);
026
027 /**
028 * @return the MIME type specified when the file was uploaded. May return null if the content type is not known.
029 */
030 String getContentType();
031
032 void setContentType(String contentType);
033
034 /**
035 * @return the actual file contents
036 */
037 byte[] getBytes();
038
039 void setBytes(byte[] bytes);
040
041 /**
042 * Clean and reset the internal state to leave it as a newly created object.
043 */
044 void reset();
045
046 }