1 10 package org.mmbase.util; 11 12 import java.io.*; 13 import java.util.*; 14 import javax.servlet.http.HttpServletRequest ; 15 16 import org.mmbase.util.xml.*; 17 import org.mmbase.util.logging.Logger; 18 import org.mmbase.util.logging.Logging; 19 20 29 public class HttpPost { 30 31 private static Logger log = Logging.getLoggerInstance(HttpPost.class); 33 34 public static final String CONFIG_FILE = "httppost.xml"; 35 36 public static final String MAX_REQUEST_SIZE_PROPERTY = "maxrequestsize"; 37 public static final String MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY = "maxinmemoryparametersize"; 38 public static final String MAX_PARAMETER_SIZE_PROPERTY = "maxparametersize"; 39 public static final String UPLOAD_DIR_PROPERTY = "uploaddir"; 40 41 public static final int DEFAULT_MAX_REQUEST_SIZE = 4 * 1024 * 1024; public static final int DEFAULT_MAX_PARAMETER_SIZE = 4 * 1024 * 1024; public static final int DEFAULT_MAX_IN_MEMORY_PARAMETER_SIZE =4 * 1024 * 1024; 45 private int maxRequestSize = DEFAULT_MAX_REQUEST_SIZE; 46 private int maxParameterSize = DEFAULT_MAX_PARAMETER_SIZE; 47 private int maxInMemoryParameterSize = DEFAULT_MAX_IN_MEMORY_PARAMETER_SIZE; 48 private String uploadDir = "/tmp/"; 49 50 53 private boolean isRequestDecoded = false; 54 55 58 private long postid; 59 60 63 private Hashtable postValues = new Hashtable(); 64 65 68 private boolean isPostedToDisk = false; 69 70 private HttpServletRequest req = null; 71 72 private static UtilReader utilReader = new UtilReader(CONFIG_FILE); 73 74 int maxLoop = 20000; 75 76 79 public HttpPost(HttpServletRequest req) { 80 this.req = req; 81 82 Map properties = utilReader.getProperties(); 83 setProperties(properties); 84 postid = System.currentTimeMillis(); 85 if (log.isDebugEnabled()) { 86 log.debug("initialized HttpPost (maxRequestSize,maxParameterSize,maxInMemoryParameterSize)=(" + maxRequestSize + "," + maxParameterSize + "," + maxInMemoryParameterSize + ")"); 87 } 88 } 89 90 93 protected void finalize() { 94 reset(); 95 } 96 97 100 public void reset() { 101 102 if (isPostedToDisk) { 103 File f = new File(uploadDir); 104 File[] files = f.listFiles(); 105 for (int i = 0; i < files.length; i++) { 106 if (files[i].getName().indexOf("form_" + postid) == 0) { 107 files[i].delete(); 108 } 109 } 110 } 111 postid = 0; isPostedToDisk = false; } 114 115 123 public boolean checkPostMultiParameter(String name) throws PostValueToLargeException { 124 if (!isRequestDecoded) { 125 decodePost(req); 126 } 127 128 Object obj = postValues.get(name); 129 if (obj != null && obj instanceof Vector) { 130 return true; 131 } 132 return false; 133 } 134 135 143 public Hashtable getPostParameters() throws PostValueToLargeException { 144 if (!isRequestDecoded) { 145 decodePost(req); 146 } 147 return postValues; 148 } 149 150 158 public byte[] getPostParameterBytes(String name) throws PostValueToLargeException { 159 if (!isRequestDecoded) { 161 decodePost(req); 162 } 163 164 Object obj = postValues.get(name); 166 if (obj == null) { 167 return null; 168 } 169 170 if (obj instanceof String ) { 172 String msg = "Use getPostParameterFile"; 173 log.warn(msg); 174 throw new PostValueToLargeException("Use getPostParameterFile"); 175 } 176 if (obj instanceof Vector) { 177 Vector v = (Vector)obj; 178 byte[] data = (byte[])v.elementAt(0); 179 return data; 180 } 181 byte[] data = (byte[])obj; 182 return data; 183 } 184 185 192 public Vector getPostMultiParameter(String name) throws PostValueToLargeException { 193 return getPostMultiParameter(name, null); 194 } 195 196 203 public Vector getPostMultiParameter(String name, String encoding) throws PostValueToLargeException { 204 205 if (!isRequestDecoded) { 207 decodePost(req); 208 } 209 210 Object obj = postValues.get(name); 212 if (obj == null) { 213 return null; 214 } 215 216 Vector results = new Vector(); 217 if (obj instanceof Vector) { 218 Vector v = (Vector)obj; 219 Enumeration e = v.elements(); 220 while (e.hasMoreElements()) { 221 Object o = e.nextElement(); 222 if (o.getClass().isArray()) { 223 byte[] data = (byte[])o; 224 results.addElement(getString(data, encoding)); 225 } else { 226 if (!(o instanceof String )) { 227 log.warn("unknown data type " + o.getClass().getName() + " for parameter " + name); 228 } 229 results.addElement(o); 230 } 231 } 232 } else { 233 byte[] data = (byte[])obj; 235 results.addElement(getString(data, encoding)); 236 } 237 return results; 238 } 239 240 private static String getString(byte[] data, String encoding) { 241 if (encoding == null) { 242 return new String (data); 243 } 244 try { 245 return new String (data, encoding); 246 } catch (java.io.UnsupportedEncodingException uee) { 247 log.warn("encoding was:" + encoding + "\n" + Logging.stackTrace(uee)); 248 return new String (data); 249 } 250 } 251 252 256 public boolean isPostedToFile() { 257 return isPostedToDisk; 258 } 259 260 266 public String getPostParameterFile(String name) throws PostValueToLargeException { 267 Object obj = null; 268 Vector v; 269 270 if (!isRequestDecoded) { 271 decodePost(req); 272 } 273 if ((obj = postValues.get(name)) != null) { 274 if (!(obj instanceof String )) { 276 isPostedToDisk = true; 277 File file = new File(new File(uploadDir), "form_" + postid + "_" + name); 278 RandomAccessFile raf = null; 279 try { 280 raf = new RandomAccessFile(file, "rw"); 281 if (obj instanceof Vector) { 282 v = (Vector)obj; 283 raf.write((byte[])v.elementAt(0)); 284 } else { 285 raf.write((byte[])obj); 286 } 287 raf.close(); 288 } catch (Exception e) { 289 log.error("getPostParameterFile(" + name + "): " + e); 290 } 291 return file.getPath(); 292 } 293 294 if (obj instanceof Vector) { 295 v = (Vector)obj; 296 return (String )v.elementAt(0); 297 } else { 298 return (String )obj; 299 } 300 } else { 301 return null; 302 } 303 } 304 305 311 public String getPostParameter(String name) throws PostValueToLargeException { 312 Object obj = null; 313 Vector v; 314 315 if (!isRequestDecoded) { 316 decodePost(req); 317 } 318 319 if ((obj = postValues.get(name)) != null) { 320 try { 321 if (obj instanceof String ) { 322 throw new PostValueToLargeException("Use getPostParameterFile"); 323 } 324 } catch (Exception e) { 327 log.error("getPostParameter(" + name + "): " + e); 328 } 329 330 if (obj instanceof Vector) { 331 v = (Vector)obj; 332 Object elem = v.elementAt(0); 333 if (elem instanceof String ) { 334 return (String )elem; 335 } else { 336 return new String ((byte[])v.elementAt(0)); 337 } 338 } else { 339 return new String ((byte[])obj); 340 } 341 } else { 342 return null; 343 } 344 } 345 346 private void decodePost(HttpServletRequest req) throws PostValueToLargeException { 347 isRequestDecoded = true; 348 byte[] postbuffer = null; 349 350 if (req.getHeader("Content-length") != null || req.getHeader("Content-Length") != null) { 351 postbuffer = readContentLength(req); 352 String line = (String )req.getHeader("Content-type"); 353 if (line == null) { 354 line = (String )req.getHeader("Content-Type"); 355 } 356 357 if (line != null) { 358 if (line.indexOf("application/x-www-form-urlencoded") != -1) { 359 readPostUrlEncoded(postbuffer, postValues); 360 } else if (line.indexOf("multipart/form-data") != -1) { 361 if (!isPostedToDisk) { 362 readPostFormData(postbuffer, postValues, line); 363 } else { 364 readPostFormData( new File(uploadDir,"form_" + postid).getPath(), postValues, line); 365 } 366 } else { 367 log.error("decodePost(): found no 'post' tag in post."); 368 } 369 } else { 370 log.error("decodePost(): can't find Content-Type"); 371 } 372 } else { 373 log.error("decodePost(): found no 'content-length' tag in post."); 374 } 375 } 376 377 383 public byte[] readContentLength(HttpServletRequest req) throws PostValueToLargeException { 384 int len, len2, len3; 385 byte buffer[] = null; 386 DataInputStream connect_in = null; 387 388 int i = 0; 389 390 try { 391 connect_in = new DataInputStream(req.getInputStream()); 392 } catch (Exception e) { 393 log.error("readContentLength(): can't open input stream"); 394 } 395 396 len = req.getContentLength(); 397 if (len < maxInMemoryParameterSize) { 399 log.debug("readContentLength(): writing to memory."); 400 try { 401 buffer = new byte[len]; 402 len2 = connect_in.read(buffer, 0, len); 403 while (len2 < len && i < maxLoop) { 404 log.debug("readContentLength(): found len2( " + len2 + ")"); 405 len3 = connect_in.read(buffer, len2, len - len2); 406 if (len3 == -1) { 407 log.debug("readContentLength(): WARNING: EOF while not Content Length"); 408 break; 409 } else { 410 len2 += len3; 411 } 412 i++; 413 } 414 if (i >= maxLoop) { 415 log.info("readContentLength(): (memory) broken out of loop after " + i + " times"); 416 } 417 } catch (Exception e) { 418 log.error("readContentLength(): Can't read post msg from client"); 419 log.error(Logging.stackTrace(e)); 420 buffer[len - 1] = -1; 421 424 } 425 } else if (len < maxParameterSize) { 426 log.debug("readContentLength(): writing to disk"); 427 try { 428 isPostedToDisk = true; 429 RandomAccessFile raf = new RandomAccessFile(new File(uploadDir,"form_" + postid), "rw"); 430 int bufferlength = 64000; 431 buffer = new byte[bufferlength]; 432 int index1 = 0, totallength = 0; 433 434 index1 = connect_in.read(buffer); 435 raf.write(buffer, 0, index1); 436 totallength += index1; 437 log.debug("readContentLength(): writing to disk: +"); 438 439 while (totallength < len && i < maxLoop) { 440 index1 = connect_in.read(buffer); 441 raf.write(buffer, 0, index1); 442 if (index1 == -1) { 443 log.error("readContentLength(): EOF while not Content Length"); 444 break; 445 } else { 446 totallength += index1; 447 } 448 i++; 449 } 450 if (i >= maxLoop) { 451 log.info("readContentLength(): (disk) broken out of loop after " + i + " times"); 452 } 453 log.info(" written(" + totallength + ")"); 454 raf.close(); 455 } catch (Exception e) { 456 log.error("readContentLength(): " + e); 457 } 458 } else { 459 log.error("readContentLength(): post too large: " + len + " size"); 460 throw new PostValueToLargeException("post size to large (actual,allowed)" + len + "," + maxRequestSize + ")"); 461 } 462 return buffer; 463 } 464 465 471 private String [] extractDispositionInfo(String line) throws IOException { 472 String [] retval = new String [3]; 473 474 String origline = line; 477 line = origline.toLowerCase(); 478 479 int start = line.indexOf("content-disposition: "); 481 int end = line.indexOf(";"); 482 if (start == -1 || end == -1) { 483 throw new IOException("Content disposition corrupt: " + origline); 484 } 485 String disposition = line.substring(start + 21, end); 486 if (!disposition.equals("form-data")) { 487 throw new IOException("Invalid content disposition: " + disposition); 488 } 489 490 start = line.indexOf("name=\"", end); end = line.indexOf("\"", start + 7); if (start == -1 || end == -1) { 494 throw new IOException("Content disposition corrupt: " + origline); 495 } 496 String name = origline.substring(start + 6, end); 497 498 String filename = null; 500 start = line.indexOf("filename=\"", end + 2); end = line.indexOf("\"", start + 10); if (start != -1 && end != -1) { filename = origline.substring(start + 10, end); 504 int slash = Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\')); 506 if (slash > -1) { 507 filename = filename.substring(slash + 1); } 509 510 if (filename.equals("")) { 511 filename = "unknown"; } 513 514 } 515 516 retval[0] = disposition; 518 retval[1] = name; 519 retval[2] = filename; 520 return retval; 521 } 522 523 529 private String extractContentType(String line) throws IOException { 530 String contentType = null; 531 532 String origline = line; 534 line = origline.toLowerCase(); 535 536 if (line.startsWith("content-type")) { 538 int start = line.indexOf(" "); 539 if (start == -1) { 540 throw new IOException("Content type corrupt: " + origline); 541 } 542 contentType = line.substring(start + 1); 543 } else if (line.length() != 0) { throw new IOException("Malformed line after disposition: " + origline); 545 } 546 547 return contentType; 548 } 549 550 556 public boolean readPostFormData(byte[] postbuffer, Hashtable post_header, String line) { 557 int i2, i3, i4, start2, end2; 558 String r; 559 String templine = "--" + line.substring(line.indexOf("boundary=") + 9); 560 byte[] marker = new byte[templine.length()]; 561 byte[] marker2 = new byte[4]; 562 byte[] marker3 = new byte[1]; 563 byte[] marker4 = new byte[1]; 564 byte[] dest; 565 marker2[0] = (byte)'\r'; 566 marker2[1] = (byte)'\n'; 567 marker2[2] = (byte)'\r'; 568 marker2[3] = (byte)'\n'; 569 marker3[0] = (byte)'='; 570 marker4[0] = (byte)'\"'; 571 templine.getBytes(0, templine.length(), marker, 0); 572 573 start2 = indexOf(postbuffer, marker, 0) + marker.length; 574 575 int z = 0; 576 do { 577 end2 = indexOf(postbuffer, marker, start2); 579 if (end2 < 0) { 580 log.error("readPostFormData(): postbuffer < 0 !!!! "); 581 break; 582 } 583 584 i2 = indexOf(postbuffer, marker2, start2); 586 587 597 String disposition = new String (postbuffer, start2 + 2, i2 - (start2 + 2)); 598 int separator = indexOf(postbuffer, new byte[] {(byte)'\r', (byte)'\n' }, start2 + 2); 599 600 int filesize = (end2 - i2 - 6); 601 if (filesize < 0) 602 filesize = 0; 608 if (separator > start2 + 2 && separator < i2) { 609 try { 610 String [] dispositionInfo = extractDispositionInfo(disposition.substring(0, separator - (start2 + 2))); 611 String mimetype = extractContentType(disposition.substring(separator - (start2 + 2) + 2)); 612 String fieldname = dispositionInfo[1]; 613 String filename = dispositionInfo[2]; 614 Vector v1 = new Vector(); 615 v1.addElement(mimetype.getBytes()); 616 addpostinfo(post_header, fieldname + "_type", v1); 617 Vector v2 = new Vector(); 618 v2.addElement(filename.getBytes()); 619 addpostinfo(post_header, fieldname + "_name", v2); 620 621 Vector v3 = new Vector(); 622 v3.addElement("" + filesize); 623 addpostinfo(post_header, fieldname + "_size", v3); 624 625 if (log.isDebugEnabled()) { 626 log.debug("mimetype = " + mimetype); 627 log.debug("filename = " + dispositionInfo[2]); 628 log.debug("filesize = " + filesize); 629 } 630 } catch (IOException e) { 631 log.error(e.getMessage()); 632 } 633 } 634 636 i3 = indexOf(postbuffer, marker3, start2 + 2) + 2; 637 i4 = indexOf(postbuffer, marker4, i3 + 2); 638 r = new String (postbuffer, i3, (i4 - i3)); dest = new byte[filesize]; 643 System.arraycopy(postbuffer, i2 + 4, dest, 0, filesize); 644 646 addpostinfo(post_header, r, dest); 647 start2 = end2 + marker.length; 648 z++; 649 } while (postbuffer[start2] != '-' && z < maxLoop); 650 if (z >= maxLoop) { 651 log.info("readPostFormData: broken out of loop after " + z + " times"); 652 } 653 return false; 654 } 655 656 666 public boolean readPostFormData(String formFile, Hashtable post_header, String line) { 667 FileInputStream fis = null; 668 RandomAccessFile raf = null; 669 try { 670 fis = new FileInputStream(formFile); 671 } catch (Exception e) { 672 System.out.println("WorkerPostHandler -> File " + formFile + " not exist"); 673 } 674 int i, i2, i3, i4, start2, end2; 675 String r; 676 String templine = "--" + line.substring(line.indexOf("boundary=") + 9); 677 byte[] marker = new byte[templine.length()]; 678 byte[] marker2 = new byte[4]; 679 byte[] marker3 = new byte[1]; 680 byte[] marker4 = new byte[1]; 681 byte[] dest; 682 marker2[0] = (byte)'\r'; 683 marker2[1] = (byte)'\n'; 684 marker2[2] = (byte)'\r'; 685 marker2[3] = (byte)'\n'; 686 marker3[0] = (byte)'='; 687 marker4[0] = (byte)'\"'; 688 templine.getBytes(0, templine.length(), marker, 0); 689 log.info("readPostFormData(): begin"); 690 691 int offset = 0; 692 int len = 64000; 694 byte postbuffer[] = new byte[len]; 695 try { 696 len = fis.read(postbuffer); 698 699 start2 = indexOf(postbuffer, marker, 0) + marker.length; 701 i = 0; 702 do { 703 i3 = indexOf(postbuffer, marker3, start2 + 2) + 2; 705 i4 = indexOf(postbuffer, marker4, i3 + 2); 706 r = new String (postbuffer, i3, (i4 - i3)); 707 log.debug("readPostFormData(): postName=" + r); 708 709 end2 = indexOf(postbuffer, marker, start2); 711 i2 = indexOf(postbuffer, marker2, start2); 712 713 if (end2 == -1) { 714 log.info("readPostFormData(): writing to postValue: "); 715 File f = new File(uploadDir,"form_" + postid + "_" + r); 716 raf = new RandomAccessFile(f, "rw"); 717 addpostinfo(post_header, r, f.getPath()); 718 try { 719 raf.write(postbuffer, i2 + 4, len - (i2 + 4)); 720 } catch (Exception e) { 721 log.error("readPostFormData(): Cannot write into file(1)" + e); 722 } 723 offset = len - i2 + 4; 724 int j = 0; 725 do { 726 fis.read(postbuffer); 729 730 end2 = indexOf(postbuffer, marker, 0); 731 if (end2 == -1) { 732 raf.write(postbuffer); 733 } else { 734 raf.write(postbuffer, 0, end2 - 2); 735 } 736 offset += len; 737 j++; 738 } while (end2 == -1 && j < maxLoop); 739 if (j >= maxLoop) { 740 log.info("readPostFormData(): (inner) broken out of loop after " + j + " times"); 741 } 742 start2 = end2 + marker.length; 743 raf.close(); 744 } else { 745 dest = new byte[(end2 - i2) - 6]; 746 System.arraycopy(postbuffer, i2 + 4, dest, 0, (end2 - i2) - 6); 747 748 addpostinfo(post_header, r, dest); 749 start2 = end2 + marker.length; 750 } 751 i++; 752 } 753 while (postbuffer[start2] != '-' && i < maxLoop); 754 if (i >= maxLoop) { 755 log.info("readPostFormData(): (outer) broken out of loop after " + i + " times"); 756 } 757 } catch (Exception e) { 758 log.error("readPostFormData(): Reached end of file: " + e); 759 } 760 return false; 761 } 762 763 private final void addpostinfo(Hashtable postinfo, String name, Object value) { 764 Object obj; 765 Vector v = null; 766 767 if (postinfo.containsKey(name)) { 768 obj = postinfo.get(name); 769 if (obj instanceof byte[]) { 770 v = new Vector(); 771 v.addElement((byte[])obj); v.addElement(value); postinfo.put(name, v); 774 } else if (obj instanceof Vector) { 775 v = (Vector)obj; 776 v.addElement(value); 777 } else { 778 log.error("addpostinfo(" + name + "," + value + "): object " + v + " is not Vector or byte[]"); 779 } 780 } else { 781 postinfo.put(name, value); 782 } 783 } 784 785 private final void addpostinfo2(Hashtable postinfo, String name, String values) { 786 Object obj; 787 Vector v = null; 788 789 byte[] value = new byte[values.length()]; 790 values.getBytes(0, values.length(), value, 0); 791 792 if (postinfo.containsKey(name)) { 793 obj = postinfo.get(name); 794 if (obj instanceof byte[]) { 795 v = new Vector(); 796 v.addElement((byte[])obj); v.addElement(value); postinfo.put(name, v); 799 } else if (obj instanceof Vector) { 800 v = (Vector)obj; 801 v.addElement(value); 802 } else { 803 log.error("addpostinfo(" + name + "," + value + "): object " + v + " is not Vector or byte[]"); 804 } 805 } else { 806 postinfo.put(name, value); 807 } 808 } 809 810 816 private boolean readPostUrlEncoded(byte[] postbuffer, Hashtable post_header) { 817 String mimestr = ""; 818 int i = 0, idx; 819 char letter; 820 821 String buffer = new String (postbuffer); 822 buffer = buffer.replace('+', ' '); 823 StringTokenizer tok = new StringTokenizer(buffer, "&"); 824 int z = 0; 825 while (tok.hasMoreTokens() && i < maxLoop) { 826 mimestr = tok.nextToken(); 827 if ((idx = mimestr.indexOf('=')) != -1) { 828 while ((i = mimestr.indexOf('%', i)) != -1) { 829 try { 831 letter = (char)Integer.parseInt(mimestr.substring(i + 1, i + 3), 16); 832 mimestr = mimestr.substring(0, i) + letter + mimestr.substring(i + 3); 833 } catch (Exception e) {} 834 835 i++; 836 } 837 addpostinfo2(post_header, mimestr.substring(0, idx), mimestr.substring(idx + 1)); 838 } else { 839 addpostinfo2(post_header, mimestr, ""); 840 } 841 z++; 842 } 843 if (z >= maxLoop) { 844 log.info("readPostUrlEncoded: broken out of loop after " + z + " times"); 845 } 846 return true; 847 } 848 849 857 private int indexOf(byte v1[], byte v2[], int fromIndex) { 858 859 int max = (v1.length - v2.length); 860 861 test : for (int i = ((fromIndex < 0) ? 0 : fromIndex); i <= max; i++) { 865 int n = v2.length; 866 int j = i; 867 int k = 0; 868 while (n-- != 0) { 869 if (v1[j++] != v2[k++]) { 870 continue test; 871 } 872 } 873 return i; 874 } 875 return -1; 876 } 877 878 private void setProperties(Map properties) { 879 if (properties.containsKey(MAX_PARAMETER_SIZE_PROPERTY)) { 881 try { 882 maxParameterSize = Integer.parseInt(properties.get(MAX_PARAMETER_SIZE_PROPERTY).toString()); 883 } catch (NumberFormatException e) { 884 log.warn("The value{" + properties.get(MAX_PARAMETER_SIZE_PROPERTY) + "} of property {" + MAX_PARAMETER_SIZE_PROPERTY + "} in file " + CONFIG_FILE + " is not a integer"); 885 } 886 } 887 888 if (properties.containsKey(MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY)) { 889 try { 890 maxInMemoryParameterSize = Integer.parseInt(properties.get(MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY).toString()); 891 } catch (NumberFormatException e) { 892 log.warn("The value{" + properties.get(MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY) + "} of property {" + MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY + "} in file " + CONFIG_FILE + " is not a integer"); 893 } 894 } 895 896 if (properties.containsKey(MAX_REQUEST_SIZE_PROPERTY)) { 897 try { 898 maxRequestSize = Integer.parseInt(properties.get(MAX_REQUEST_SIZE_PROPERTY).toString()); 899 } catch (NumberFormatException e) { 900 log.warn("The value{" + properties.get(MAX_REQUEST_SIZE_PROPERTY) + "} of property {" + MAX_REQUEST_SIZE_PROPERTY + "} in file " + CONFIG_FILE + " is not a integer"); 901 } 902 } 903 if (properties.containsKey(UPLOAD_DIR_PROPERTY)) { 904 String tmpDir = properties.get(UPLOAD_DIR_PROPERTY).toString(); 905 File file = new File(tmpDir); 906 if (file.exists() && file.isDirectory()) { 907 uploadDir = tmpDir; 908 } else { 909 log.warn("The value {" + properties.get(UPLOAD_DIR_PROPERTY) + "} of property {" + UPLOAD_DIR_PROPERTY + "} in file " + CONFIG_FILE + " is not a directory {" + file.getPath() + "}"); 910 } 911 file = null; 912 } 913 if (maxInMemoryParameterSize > maxRequestSize){ 915 log.warn(MAX_IN_MEMORY_PARAMETER_SIZE_PROPERTY + " is bigger then " + MAX_REQUEST_SIZE_PROPERTY); 916 } 917 } 918 } 919 | Popular Tags |