|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FileElement
The FileElement represents a file within a flexi form. It offers a read only view of files and an upload view.
Initial Date: 08.12.2008
| Field Summary | |
|---|---|
static int |
UPLOAD_ONE_MEGABYTE
|
static int |
UPLOAD_UNLIMITED
|
| Fields inherited from interface org.olat.core.gui.components.form.flexible.FormItem |
|---|
ERRORC, EXAMPLEC, LABELC |
| Fields inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider |
|---|
DISPPREFIX |
| Method Summary | |
|---|---|
java.io.File |
getInitialFile()
Get the initial file value |
java.util.Set<java.lang.String> |
getMimeTypeLimitations()
Get the set of the mime types limitation |
java.io.File |
getUploadFile()
Use the upload file only for temporary checks on the file. |
java.lang.String |
getUploadFileName()
|
java.io.InputStream |
getUploadInputStream()
Get the input stream of the uploaded file to copy it to some other place |
java.lang.String |
getUploadMimeType()
|
long |
getUploadSize()
Get the size of the uploaded file |
boolean |
isUploadSuccess()
|
void |
limitToMimeType(java.util.Set<java.lang.String> mimeTypes,
java.lang.String i18nErrKey,
java.lang.String[] i18nArgs)
Set a mime type limitation on which files are allowed in the upload process. |
java.io.File |
moveUploadFileTo(java.io.File destinationDir)
Move the uploaded file from the temporary location to the given destination directory. |
void |
setInitialFile(java.io.File initialFile)
Set an initial value for the file element. |
void |
setMandatory(boolean mandatory,
java.lang.String i18nErrKey)
Set this form element mandatory. |
void |
setMaxUploadSizeKB(int maxFileSizeKB,
java.lang.String i18nErrKey,
java.lang.String[] i18nArgs)
Set the KB that are allowed in the file upload. |
| Methods inherited from interface org.olat.core.gui.components.form.flexible.FormMultipartItem |
|---|
getMaxUploadSizeKB |
| Methods inherited from interface org.olat.core.gui.components.form.flexible.FormItem |
|---|
addActionListener, clearError, doDispatchFormRequest, evalFormRequest, getAction, getActionListenersFor, getComponent, getErrorC, getErrorText, getExampleC, getExampleText, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isMandatory, isVisible, reset, setEnabled, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, setUserObject, setVisible, showError, showExample, showLabel, validate |
| Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider |
|---|
getFormDispatchId |
| Field Detail |
|---|
static final int UPLOAD_ONE_MEGABYTE
static final int UPLOAD_UNLIMITED
| Method Detail |
|---|
void setInitialFile(java.io.File initialFile)
initialFile - java.io.File getInitialFile()
void setMaxUploadSizeKB(int maxFileSizeKB,
java.lang.String i18nErrKey,
java.lang.String[] i18nArgs)
maxFileSizeKB - max file size in KBi18nErrKey - i18n key used in case user uploaded to big filei18nArgs - optional arguments for thei18nErrKey
void limitToMimeType(java.util.Set<java.lang.String> mimeTypes,
java.lang.String i18nErrKey,
java.lang.String[] i18nArgs)
mimeTypes - i18nErrKey - i18n key used in case user uploaded wrong filesi18nArgs - optional arguments for thei18nErrKeyjava.util.Set<java.lang.String> getMimeTypeLimitations()
void setMandatory(boolean mandatory,
java.lang.String i18nErrKey)
mandatory - true: is mandatory; false: is optionali18nErrKey - i18n key used in case user did not upload somethingboolean isUploadSuccess()
long getUploadSize()
java.lang.String getUploadFileName()
java.lang.String getUploadMimeType()
java.io.File getUploadFile()
java.io.InputStream getUploadInputStream()
java.io.File moveUploadFileTo(java.io.File destinationDir)
If in the destination a file with the given name does already exist, rename the file accordingly
destinationDir -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||