1 5 package com.opensymphony.webwork.dispatcher.multipart; 6 7 import org.apache.commons.logging.Log; 8 import org.apache.commons.logging.LogFactory; 9 10 import javax.servlet.http.HttpServletRequest ; 11 import java.io.File ; 12 import java.util.Enumeration ; 13 import java.util.List ; 14 15 16 23 public abstract class MultiPartRequest { 24 26 protected static Log log = LogFactory.getLog(MultiPartRequest.class); 27 28 30 36 public static boolean isMultiPart(HttpServletRequest request) { 37 String content_type = request.getContentType(); 38 return content_type != null && content_type.indexOf("multipart/form-data") != -1; 39 } 40 41 46 public abstract Enumeration getFileParameterNames(); 47 48 57 public abstract String [] getContentType(String fieldName); 58 59 66 public abstract File [] getFile(String fieldName); 67 68 74 public abstract String [] getFileNames(String fieldName); 75 76 83 public abstract String [] getFilesystemName(String fieldName); 84 85 91 public abstract String getParameter(String name); 92 93 98 public abstract Enumeration getParameterNames(); 99 100 107 public abstract String [] getParameterValues(String name); 108 109 118 public abstract List getErrors(); 119 } 120 | Popular Tags |