+++ /dev/null
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- * * http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- * * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package org.onap.aaf.cadi;\r
-\r
-import java.io.BufferedReader;\r
-import java.io.IOException;\r
-import java.io.InputStreamReader;\r
-\r
-import javax.servlet.http.HttpServletRequest;\r
-\r
-/**\r
- * BufferedCadiWrap exists to additionally wrap the InputStream with a BufferedInputStream to engage the\r
- * "mark()/release()" API of InputStream.\r
- * \r
- * This is a requirement for Re-Reading Content for brain-dead Middleware such as SOAP WS-Security.\r
- * \r
- * Framework needs to set the TafResp and Lur (typically) later in the \r
- * \r
- *\r
- */\r
-public class BufferedCadiWrap extends CadiWrap {\r
- private BufferedServletInputStream sis;\r
- \r
- public BufferedCadiWrap(HttpServletRequest request) {\r
- super(request, null, null); // will need to set TafResp and Lur separately\r
- sis = null;\r
- }\r
-\r
-\r
- // @Override\r
- public BufferedServletInputStream getInputStream() throws IOException {\r
-// System.out.println("getInputStream() from Buffered CadiWrap... sis = " + sis);\r
-// try {\r
-// throw new Exception("OK, here's where we are...");\r
-// } catch (Exception e) {\r
-// e.printStackTrace();\r
-// }\r
- if(sis==null) {\r
- sis = new BufferedServletInputStream(super.getInputStream());\r
-// } else {\r
-// try {\r
-// System.out.println("sis has " + sis.buffered() + " buffered bytes, and reports " + sis.available() + " available");\r
-// } catch (Exception e) {\r
-// e.printStackTrace();\r
-// }\r
- }\r
- return sis;\r
- }\r
-\r
- // @Override\r
- public BufferedReader getReader() throws IOException {\r
-// System.out.println("getReader() from Buffered CadiWrap... sis = " + sis);\r
-// try {\r
-// throw new Exception("OK, here's where we are...");\r
-// } catch (Exception e) {\r
-// e.printStackTrace();\r
-// }\r
- return new BufferedReader(new InputStreamReader(getInputStream()));\r
- }\r
-}\r