|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.spray.filter.DefaultFilter
org.norther.tammi.spray.filter.DefaultKeyFilter
org.norther.tammi.spray.filter.DefaultSecureKeyFilter
org.norther.tammi.spray.media.DefaultFileUploadFilter
public class DefaultFileUploadFilter
A default implementation of FileUploadFilter.
| Field Summary | |
|---|---|
static String |
UPLOAD_KEY
The default key. |
| Fields inherited from class org.norther.tammi.spray.filter.DefaultKeyFilter |
|---|
DEFAULT_KEY |
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultFileUploadFilter()
Constructs a new filter. |
|
DefaultFileUploadFilter(String key)
Constructs a new filter with a key. |
|
| Method Summary | |
|---|---|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
protected void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain,
String fileField)
Filters the information from the request and protocol extension and uploads the files provided as multipart streams. |
File |
getUploadedFile(String file)
Gets the full path of the uploaded file. |
int |
getUploadFileLimit()
Gets the limit for the number of upload files. |
String |
getUploadFolderPath()
Gets the folder path into which to upload the files. |
String |
getUploadKey()
Gets the key of the folder into which to upload the files. |
int |
getUploadPathLimit()
Gets the limit for the lenght of the upload path. |
int |
getUploadSizeLimit()
Gets the limit for the size of the upload content. |
boolean |
isOverwriteEnabled()
Gets the flag that indicates whether a file with the same name may overwrite an existing file in the upload folder. |
void |
setOverwriteEnabled(boolean flag)
Sets the flag that indicates whether a file with the same name may overwrite an existing file in the upload folder. |
void |
setUploadFileLimit(int limit)
Sets the limit for the number of upload files. |
void |
setUploadFolderPath(String folder)
Sets the folder path into which to upload the files. |
void |
setUploadKey(String key)
Sets the key of the folder into which to upload the files. |
void |
setUploadPathLimit(int limit)
Sets a limit for the lenght of the upload path. |
void |
setUploadSizeLimit(int limit)
Sets the limit for the size of the upload content. |
protected String |
uploadFile(String path,
InputStream input)
Uploads the file by writing the input stream to the named file. |
| Methods inherited from class org.norther.tammi.spray.filter.DefaultKeyFilter |
|---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
| Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter |
|---|
destroy, getFilterConfig, getRequestMap, getSessionMap, init |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter |
|---|
checkPermission, checkPermission, checkPermission |
| Methods inherited from interface org.norther.tammi.core.security.AccessController |
|---|
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, init |
| Methods inherited from interface org.norther.tammi.spray.filter.KeyFilter |
|---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
| Methods inherited from interface javax.servlet.Filter |
|---|
destroy, init |
| Field Detail |
|---|
public static final String UPLOAD_KEY
| Constructor Detail |
|---|
public DefaultFileUploadFilter()
public DefaultFileUploadFilter(String key)
key - the filter key.| Method Detail |
|---|
public String getUploadKey()
FileUploadFilter
getUploadKey in interface FileUploadFilterpublic void setUploadKey(String key)
FileUploadFilter
setUploadKey in interface FileUploadFilterkey - the upload key.public String getUploadFolderPath()
FileUploadFilter
getUploadFolderPath in interface FileUploadFilterpublic void setUploadFolderPath(String folder)
FileUploadFilter
setUploadFolderPath in interface FileUploadFilterfolder - the folder either as an absolute path or relative to the
key folder.public boolean isOverwriteEnabled()
FileUploadFilter
isOverwriteEnabled in interface FileUploadFilterpublic void setOverwriteEnabled(boolean flag)
FileUploadFilter
setOverwriteEnabled in interface FileUploadFilterflag - the flag, give true if files may be overwritten, otherwise
false.public int getUploadSizeLimit()
FileUploadFilter
getUploadSizeLimit in interface FileUploadFilterpublic void setUploadSizeLimit(int limit)
FileUploadFilter
setUploadSizeLimit in interface FileUploadFilterlimit - the limit for the upload size in bytes, or -1 if unlimited.public int getUploadPathLimit()
FileUploadFilter
getUploadPathLimit in interface FileUploadFilterpublic void setUploadPathLimit(int limit)
FileUploadFilter
setUploadPathLimit in interface FileUploadFilterlimit - the limit for the upload path in chars, or -1 if unlimited.public int getUploadFileLimit()
FileUploadFilter
getUploadFileLimit in interface FileUploadFilterpublic void setUploadFileLimit(int limit)
FileUploadFilter
setUploadFileLimit in interface FileUploadFilterlimit - the limit for the upload files, or -1 if unlimited.public File getUploadedFile(String file)
FileUploadFilter
getUploadedFile in interface FileUploadFilterfile - the uploaded file.
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws ServletException,
IOException
doFilter in interface FilterdoFilter in class DefaultFilterServletException
IOException
protected void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain,
String fileField)
throws IOException
request - the request.response - the response.chain - the filter chain.fileField - the file name field name.
IOException - on I/O errors.
protected String uploadFile(String path,
InputStream input)
throws LogException
path - the file name.input - the input stream.
LogException - if upload fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||