Exemplo n.º 1
0
 /** if http method is POST or PUT, when the business process finish, it must close piped stream */
 void releaseInputStreamData() {
   try {
     if (getContentLength() > 0) {
       if (bodyPipedStream != null) {
         bodyPipedStream.close();
       }
       if (multipartFormData != null) {
         multipartFormData.close();
       }
     }
   } catch (Throwable t) {
     log.error("release input stream error", t);
   }
 }
Exemplo n.º 2
0
  @Override
  public Collection<Part> getParts() throws IOException, ServletException {
    if (multipartFormData == null) {
      ServletInputStream input = null;
      try {
        input = getInputStream();
        PartImpl.tempdir = config.getTempdir();
        multipartFormData =
            new MultipartFormData(
                MultipartFormDataParser.parse(input, getHeader("Content-Type"), characterEncoding));
      } finally {
        input.close();
      }
    }

    return multipartFormData.getParts();
  }
Exemplo n.º 3
0
  @Override
  public Part getPart(String name) throws IOException, ServletException {
    if (multipartFormData == null) getParts();

    return multipartFormData.getPart(name);
  }