UploadedFiles defines the set of files that have been uploaded
to the server.
| Method from org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles Detail: |
void __put(String name,
UploadedFile file) {
_map.put(name, file);
}
Store a single UploadedFile. |
public void dispose() {
Iterator< UploadedFile > iterator = _map.values().iterator();
while (iterator.hasNext())
{
UploadedFile file = iterator.next();
file.dispose();
}
_map.clear();
_totalMemory = 0;
_totalDiskSpace = 0;
}
Dispose of all UploadedFiles. This will happen automatically
when the current request ends, so clients do not need to
call this method. However, if a developer is finished with
processing files, this will free up resources earlier. |
public long getTotalDiskSpace() {
return _totalDiskSpace;
}
Return the tally of total disk space used. |
public long getTotalMemory() {
return _totalMemory;
}
Return the tally of total memory used. |
public UploadedFile getUploadedFile(String name) {
UploadedFile file = _map.get(name);
if (file == null)
return null;
return new FixFilename(file, _characterEncoding);
}
Returns a single uploaded file. |
public static UploadedFiles getUploadedFiles(FacesContext context) {
Map< String, Object > requestMap =
context.getExternalContext().getRequestMap();
return (UploadedFiles) requestMap.get(_UPLOADED_FILES_KEY);
}
Returns the map of uploaded files for the current request. |
public Iterator getUploadedNames() {
return _map.keySet().iterator();
}
Returns an Iterator of the names of all uploaded files. |
public static void setCharacterEncoding(ExternalContext externalContext,
String encoding) {
UploadedFiles files = (UploadedFiles)
externalContext.getRequestMap().get(_UPLOADED_FILES_KEY);
_setCharacterEncoding(files, encoding);
}
Store the character encoding for the current request. |
public static void setCharacterEncoding(HttpServletRequest req,
String encoding) {
UploadedFiles files = (UploadedFiles)
req.getAttribute(_UPLOADED_FILES_KEY);
_setCharacterEncoding(files, encoding);
}
|
public static void setCharacterEncoding(PortletRequest req,
String encoding) {
UploadedFiles files = (UploadedFiles)
req.getAttribute(_UPLOADED_FILES_KEY);
_setCharacterEncoding(files, encoding);
}
|