Changeset fbbab0d
- Timestamp:
- Dec 23, 2011 1:01:40 AM (9 years ago)
- Branches:
- master
- Children:
- 41ea292
- Parents:
- 56901e5
- Location:
- apps/susimail/src/src/org/mortbay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/susimail/src/src/org/mortbay/servlet/MultiPartRequest.java
r56901e5 rfbbab0d 28 28 import javax.servlet.http.HttpServletRequest; 29 29 30 import org.apache.commons.logging.Log;31 import org.mortbay.log.LogFactory;32 import org.mortbay. http.HttpFields;30 //import org.apache.commons.logging.Log; 31 //import org.mortbay.log.LogFactory; 32 import org.mortbay.jetty.HttpHeaders; 33 33 import org.mortbay.util.LineInput; 34 34 import org.mortbay.util.MultiMap; … … 49 49 * </pre> 50 50 * 51 * Modded to compile with Jetty 6 for I2P 52 * 51 53 * @version $Id: MultiPartRequest.java,v 1.16 2005/12/02 20:13:52 gregwilkins Exp $ 52 54 * @author Greg Wilkins … … 55 57 public class MultiPartRequest 56 58 { 57 private static Log log = LogFactory.getLog(MultiPartRequest.class);59 //private static Log log = LogFactory.getLog(MultiPartRequest.class); 58 60 59 61 /* ------------------------------------------------------------ */ … … 77 79 { 78 80 _request=request; 79 String content_type = request.getHeader(Http Fields.__ContentType);81 String content_type = request.getHeader(HttpHeaders.CONTENT_TYPE); 80 82 if (!content_type.startsWith("multipart/form-data")) 81 83 throw new IOException("Not multipart/form-data request"); 82 84 83 if(log.isDebugEnabled())log.debug("Multipart content type = "+content_type);85 //if(log.isDebugEnabled())log.debug("Multipart content type = "+content_type); 84 86 _encoding = request.getCharacterEncoding(); 85 87 if (_encoding != null) … … 92 94 value(content_type.substring(content_type.indexOf("boundary="))); 93 95 94 if(log.isDebugEnabled())log.debug("Boundary="+_boundary);96 //if(log.isDebugEnabled())log.debug("Boundary="+_boundary); 95 97 _byteBoundary= (_boundary+"--").getBytes(StringUtil.__ISO_8859_1); 96 98 … … 137 139 catch (UnsupportedEncodingException uee) 138 140 { 139 if (log.isDebugEnabled())log.debug("Invalid character set: " + uee);141 //if (log.isDebugEnabled())log.debug("Invalid character set: " + uee); 140 142 return null; 141 143 } … … 171 173 catch (UnsupportedEncodingException uee) 172 174 { 173 if (log.isDebugEnabled())log.debug("Invalid character set: " + uee);175 //if (log.isDebugEnabled())log.debug("Invalid character set: " + uee); 174 176 return null; 175 177 } … … 265 267 if (!line.equals(_boundary)) 266 268 { 267 log.warn(line);269 //log.warn(line); 268 270 throw new IOException("Missing initial multi part boundary"); 269 271 } … … 282 284 break; 283 285 284 if(log.isDebugEnabled())log.debug("LINE="+line);286 //if(log.isDebugEnabled())log.debug("LINE="+line); 285 287 286 288 // place part header key and value in map … … 292 294 String ev = (String) part._headers.get(key); 293 295 part._headers.put(key,(ev!=null)?(ev+';'+value):value); 294 if(log.isDebugEnabled())log.debug(key+": "+value);296 //if(log.isDebugEnabled())log.debug(key+": "+value); 295 297 if (key.equals("content-disposition")) 296 298 content_disposition=value; … … 322 324 if (!form_data) 323 325 { 324 log.warn("Non form-data part in multipart/form-data");326 //log.warn("Non form-data part in multipart/form-data"); 325 327 continue; 326 328 } 327 329 if (part._name==null || part._name.length()==0) 328 330 { 329 log.warn("Part with no name in multipart/form-data");331 //log.warn("Part with no name in multipart/form-data"); 330 332 continue; 331 333 } 332 if(log.isDebugEnabled())log.debug("name="+part._name);333 if(log.isDebugEnabled())log.debug("filename="+part._filename);334 //if(log.isDebugEnabled())log.debug("name="+part._name); 335 //if(log.isDebugEnabled())log.debug("filename="+part._filename); 334 336 _partMap.add(part._name,part); 335 337 part._data=readBytes(); … … 407 409 if (_char==10) _char=-2; 408 410 } 409 if(log.isTraceEnabled())log.trace(baos.toString());411 //if(log.isTraceEnabled())log.trace(baos.toString()); 410 412 return baos.toByteArray(); 411 413 } -
apps/susimail/src/src/org/mortbay/util/LineInput.java
r56901e5 rfbbab0d 23 23 import java.io.UnsupportedEncodingException; 24 24 25 import org.apache.commons.logging.Log;26 import org.mortbay.log.LogFactory;25 //import org.apache.commons.logging.Log; 26 //import org.mortbay.log.LogFactory; 27 27 28 28 … … 52 52 public class LineInput extends FilterInputStream 53 53 { 54 private static Log log = LogFactory.getLog(LineInput.class);54 //private static Log log = LogFactory.getLog(LineInput.class); 55 55 56 56 /* ------------------------------------------------------------ */ … … 202 202 catch(UnsupportedEncodingException e) 203 203 { 204 log.warn(LogSupport.EXCEPTION,e);204 //log.warn(LogSupport.EXCEPTION,e); 205 205 } 206 206 }
Note: See TracChangeset
for help on using the changeset viewer.