|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.web.LyFilePartWriter
public class LyFilePartWriter
This class saves attachment on server side and retrieve them on request. This class should be overridden to specify location.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
Constructor Summary | |
---|---|
LyFilePartWriter()
Constructor. |
Method Summary | |
---|---|
void |
commit(boolean keep)
Validates file upload. |
void |
computeServerFileName()
Automatically compute a valid server file name from current properties. |
void |
free()
Cleans up everything Keep parameters and internal request for later use. |
java.lang.String |
getAttachmentDirectory()
Gets the attachment directory from meta-model. |
java.lang.String |
getClientFileName()
Gets the original filename on client side. |
java.lang.String |
getContentType()
Gets file content type (sent by the client, can't verify). |
java.lang.String |
getFileLocation()
Location (address) to access to this file (stored in database) default returns getServerFileName(). |
java.lang.String |
getServerFileName()
Gets server filename (local name). |
void |
saveFile(java.io.InputStream iStream)
Saves the stream to a file on server side Takes current parameters, and if needed compute a serverFileName. |
void |
setAttachmentDirectory(java.lang.String attachmentDirectory)
Sets the attachment directory. |
void |
setClientFileName(java.lang.String fileName)
Sets the filename on client side. |
void |
setContentType(java.lang.String contentType)
Sets file content type. |
void |
setEnvironment(LyEnvironment environment)
Gets the environment. |
void |
setServerFileName(java.lang.String fileName)
Server filename (local name). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
Constructor Detail |
---|
public LyFilePartWriter()
Method Detail |
---|
public void setEnvironment(LyEnvironment environment)
environment
- Current environmentpublic void saveFile(java.io.InputStream iStream) throws java.io.IOException
iStream
- input stream to read the data from.
java.io.IOException
computeServerFileName()
public void commit(boolean keep) throws java.io.IOException
keep
- true if the file is committed, false otherwise.
java.io.IOException
public void free()
free
in interface LyFreeInterface
public java.lang.String getClientFileName()
setClientFileName(String)
public void setClientFileName(java.lang.String fileName)
fileName
- the new fileNamegetClientFileName()
public java.lang.String getServerFileName()
getFileLocation()
,
setServerFileName(String)
public java.lang.String getFileLocation()
getServerFileName()
public void computeServerFileName()
May be overriden by subclasses. This method is called when saving data and when no server filename is specified.
setServerFileName(String)
public void setServerFileName(java.lang.String fileName)
fileName
- the new server file namegetServerFileName()
public java.lang.String getContentType()
setContentType(String)
public void setContentType(java.lang.String contentType)
contentType
- the new content type (mime type). May be null.getContentType()
public java.lang.String getAttachmentDirectory()
setAttachmentDirectory(String)
public void setAttachmentDirectory(java.lang.String attachmentDirectory)
attachmentDirectory
- the new attachment directorygetAttachmentDirectory()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |