예제 #1
0
  /*
   * (non-Javadoc)
   *
   * @see
   * com.sun.jersey.spi.container.ContainerRequestFilter#filter(com.sun.jersey
   * .spi.container.ContainerRequest)
   */
  @Override
  public ContainerRequest filter(ContainerRequest request) {
    if (!initDone) {
      init();
    }
    if (logStdOut) {
      String path = request.getRequestUri().getPath();

      // mediaType=multipart/form-data;boundary=----WebKitFormBoundaryTHan76r5AkgpAuVG
      if (request.getMediaType() != null) {
        // logger.info("DELETE ME: mediaType=" + request.getMediaType()
        // + ", getType()" + request.getMediaType().getType()
        // + ", getSubType()="
        // + request.getMediaType().getSubtype());
      } else {
        logger.info("DELETE ME: mediaType is null. path=" + path);
      }
      if ((request.getMediaType() == null || !request.getMediaType().getType().equals("multipart"))
          && !path.endsWith("/service/general/logs")) {
        try {
          request = super.filter(request);
        } catch (Throwable t) {
          logger.error("Error FILTER logging. path=" + path, t);
        }
      }
    }

    return request;
  }