| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.silverpeas.servlet.FileUploadUtil
public class FileUploadUtil
Utility class for file uploading.
| Field Summary | |
|---|---|
| static String | DEFAULT_ENCODING | 
| Method Summary | |
|---|---|
| static org.apache.commons.fileupload.FileItem | getFile(javax.servlet.http.HttpServletRequest request) | 
| static org.apache.commons.fileupload.FileItem | getFile(List<org.apache.commons.fileupload.FileItem> items) | 
| static org.apache.commons.fileupload.FileItem | getFile(List<org.apache.commons.fileupload.FileItem> items,
        String parameterName) | 
| static String | getFileName(org.apache.commons.fileupload.FileItem file) | 
| static org.apache.commons.fileupload.FileItem | getOldFile(List items,
           String parameterName) | 
| static String | getOldParameter(List items,
                String parameterName) | 
| static String | getOldParameter(List items,
                String parameterName,
                String defaultValue) | 
| static String | getParameter(List<org.apache.commons.fileupload.FileItem> items,
             String parameterName)Get the parameter value from the list of FileItems. | 
| static String | getParameter(List<org.apache.commons.fileupload.FileItem> items,
             String parameterName,
             String defaultValue)Get the parameter value from the list of FileItems. | 
| static String | getParameter(List<org.apache.commons.fileupload.FileItem> items,
             String parameterName,
             String defaultValue,
             String encoding)Get the parameter value from the list of FileItems. | 
| static List<String> | getParameterValues(List<org.apache.commons.fileupload.FileItem> items,
                   String parameterName,
                   String encoding) | 
| static boolean | isRequestMultipart(javax.servlet.http.HttpServletRequest request) | 
| static List<org.apache.commons.fileupload.FileItem> | parseRequest(javax.servlet.http.HttpServletRequest request)Parses the multipart stream in the specified request to fetch the file items. | 
| static void | saveToFile(File file,
           org.apache.commons.fileupload.FileItem item) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String DEFAULT_ENCODING
| Method Detail | 
|---|
public static boolean isRequestMultipart(javax.servlet.http.HttpServletRequest request)
public static List<org.apache.commons.fileupload.FileItem> parseRequest(javax.servlet.http.HttpServletRequest request)
                                                                 throws UtilException
request - the HTTP servlet request.
UtilException - if an error occurs while fetching the file items.
public static String getParameter(List<org.apache.commons.fileupload.FileItem> items,
                                  String parameterName,
                                  String defaultValue,
                                  String encoding)
items - the items resulting from parsing the request.parameterName - defaultValue - the value to be returned if the parameter is not found.encoding - the request encoding.
public static List<String> getParameterValues(List<org.apache.commons.fileupload.FileItem> items,
                                              String parameterName,
                                              String encoding)
public static String getParameter(List<org.apache.commons.fileupload.FileItem> items,
                                  String parameterName,
                                  String defaultValue)
items - the items resulting from parsing the request.parameterName - defaultValue - the value to be returned if the parameter is not found.
public static String getParameter(List<org.apache.commons.fileupload.FileItem> items,
                                  String parameterName)
items - the items resulting from parsing the request.parameterName - 
public static String getOldParameter(List items,
                                     String parameterName)
public static String getOldParameter(List items,
                                     String parameterName,
                                     String defaultValue)
public static org.apache.commons.fileupload.FileItem getOldFile(List items,
                                                                String parameterName)
public static org.apache.commons.fileupload.FileItem getFile(List<org.apache.commons.fileupload.FileItem> items,
                                                             String parameterName)
public static org.apache.commons.fileupload.FileItem getFile(List<org.apache.commons.fileupload.FileItem> items)
public static org.apache.commons.fileupload.FileItem getFile(javax.servlet.http.HttpServletRequest request)
                                                      throws UtilException
UtilExceptionpublic static String getFileName(org.apache.commons.fileupload.FileItem file)
public static void saveToFile(File file,
                              org.apache.commons.fileupload.FileItem item)
                       throws IOException
IOException| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||