You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2018/04/11 13:56:39 UTC

svn commit: r1028238 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-multiparts.html docs/securing-cxf-services.html

Author: buildbot
Date: Wed Apr 11 13:56:39 2018
New Revision: 1028238

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/jax-rs-multiparts.html
    websites/production/cxf/content/docs/securing-cxf-services.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/jax-rs-multiparts.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-multiparts.html (original)
+++ websites/production/cxf/content/docs/jax-rs-multiparts.html Wed Apr 11 13:56:39 2018
@@ -121,11 +121,11 @@ Apache CXF -- JAX-RS Multiparts
 
 
 &#160;</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1519041404373 {padding: 0px;}
-div.rbtoc1519041404373 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1519041404373 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1523454960964 {padding: 0px;}
+div.rbtoc1523454960964 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1523454960964 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1519041404373">
+/*]]>*/</style></p><div class="toc-macro rbtoc1523454960964">
 <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSMultiparts-Readingattachments">Reading attachments</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSMultiparts-MultipartannotationandOptionalattachments">Multipart annotation and Optional attachments</a></li></ul>
 </li><li><a shape="rect" href="#JAX-RSMultiparts-Writingattachments">Writing attachments</a></li><li><a shape="rect" href="#JAX-RSMultiparts-UploadingfileswithClientAPI">Uploading files with Client API</a></li><li><a shape="rect" href="#JAX-RSMultiparts-Readinglargeattachments">Reading large attachments</a>
@@ -287,7 +287,7 @@ client.post(getClass().getResource("imag
   &lt;/jaxrs:server&gt;  
 &lt;/beans&gt;
 </pre>
-</div></div><p>Note that such properties can be set up on a per-endpoint basis. Alternatively you can set "attachmentDirectory", "attachmentThreshold" and "attachmentMaxSize" properties directly on either org.apache.cxf.jaxrs.provider.MultipartProvider or, when dealing with multipart/form-data payloads, org.apache.cxf.jaxrs.provider.FormEncodingProvider.</p><p>Alternatively, you might want to set the following system properties which will apply to all endpoints:</p><p>&gt; -Dorg.apache.cxf.io.CachedOutputStream.Threshold=102400 <br clear="none"> and<br clear="none"> &gt; -Dorg.apache.cxf.io.CachedOutputStream.OutputDirectory=/temp</p><p>Starting from CXF 2.5.0 and 2.4.4:<br clear="none"> &gt; -Dorg.apache.cxf.io.CachedOutputStream.MaxSize=10000000</p><p>Note that if a given attachment exceeds the maximum size property (default is no-limit) then HTTP 413 status will be returned.</p><h2 id="JAX-RSMultiparts-Formsandmultiparts">Forms and multiparts</h2><p>The <a shape="rect" class="ext
 ernal-link" href="http://www.w3.org/TR/html401/interact/forms.html" rel="nofollow">Forms in HTML documents</a> recommendation <a shape="rect" class="external-link" href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2" rel="nofollow">suggests</a> that multipart/form-data requests should mainly be used to upload files.</p><p>As mentioned in the previous section, one way to deal with multipart/form-data submissions is to deal directly with a CXF JAXRS Attachment class and get a Content-Disposition header and/or the underlying input stream.</p><p>It is now possible (since 2.2.5) to have individual multipart/form-data parts read by registered JAX-RS MessageBodyReaders, something that is already possible to do for types like multipart/mixed or multipart/related.</p><p>For example this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson">request</a> can be 
 handled by a method with the following signature:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>Note that such properties can be set up on a per-endpoint basis. Alternatively you can set "attachmentDirectory", "attachmentThreshold" and "attachmentMaxSize" properties directly on either org.apache.cxf.jaxrs.provider.MultipartProvider or, when dealing with multipart/form-data payloads, org.apache.cxf.jaxrs.provider.FormEncodingProvider.</p><p>Alternatively, you might want to set the following system properties which will apply to all endpoints:</p><p>&gt; -Dorg.apache.cxf.io.CachedOutputStream.Threshold=102400 <br clear="none"> and<br clear="none"> &gt; -Dorg.apache.cxf.io.CachedOutputStream.OutputDirectory=/temp</p><p>Starting from CXF 2.5.0 and 2.4.4:<br clear="none"> &gt; -Dorg.apache.cxf.io.CachedOutputStream.MaxSize=10000000</p><p>Note that if a given attachment exceeds the maximum size property (default is no-limit) then HTTP 413 status will be returned. For more information on these configuration properties, please see the documentation on <a shape="rect" hr
 ef="securing-cxf-services.html">Securing CXF Services</a>.</p><h2 id="JAX-RSMultiparts-Formsandmultiparts">Forms and multiparts</h2><p>The <a shape="rect" class="external-link" href="http://www.w3.org/TR/html401/interact/forms.html" rel="nofollow">Forms in HTML documents</a> recommendation <a shape="rect" class="external-link" href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2" rel="nofollow">suggests</a> that multipart/form-data requests should mainly be used to upload files.</p><p>As mentioned in the previous section, one way to deal with multipart/form-data submissions is to deal directly with a CXF JAXRS Attachment class and get a Content-Disposition header and/or the underlying input stream.</p><p>It is now possible (since 2.2.5) to have individual multipart/form-data parts read by registered JAX-RS MessageBodyReaders, something that is already possible to do for types like multipart/mixed or multipart/related.</p><p>For example this <a shape="rect" class="exter
 nal-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/attachmentFormJson">request</a> can be handled by a method with the following signature:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@POST
 @Path("/books/jsonform")
 @Consumes("multipart/form-data")

Modified: websites/production/cxf/content/docs/securing-cxf-services.html
==============================================================================
--- websites/production/cxf/content/docs/securing-cxf-services.html (original)
+++ websites/production/cxf/content/docs/securing-cxf-services.html Wed Apr 11 13:56:39 2018
@@ -117,11 +117,11 @@ Apache CXF -- Securing CXF Services
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1519041405325 {padding: 0px;}
-div.rbtoc1519041405325 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1519041405325 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1523454961873 {padding: 0px;}
+div.rbtoc1523454961873 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1523454961873 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1519041405325">
+/*]]>*/</style></p><div class="toc-macro rbtoc1523454961873">
 <ul class="toc-indentation"><li><a shape="rect" href="#SecuringCXFServices-Securetransports">Secure transports</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#SecuringCXFServices-HTTPS">HTTPS</a></li></ul>
 </li><li><a shape="rect" href="#SecuringCXFServices-SecuringJAX-WSservices">Securing JAX-WS services</a>
@@ -220,7 +220,7 @@ div.rbtoc1519041405325 li {margin-left:
 &lt;jaxrs:server&gt;
 
 </pre>
-</div></div><p>When one of the limits is reached, the error is returned. JAX-WS consumers will receive 500, JAX-RS/HTTP consumers: 413.</p><p>The following system properties can also be set up for JAX-WS endpoints: "org.apache.cxf.staxutils.innerElementCountThreshold" and "org.apache.cxf.staxutils.innerElementLevelThreshold".</p><p>Please check this <a shape="rect" href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Data+Bindings#JAX-RSDataBindings-ControllingLargeJAXBXMLandJSONinputpayloads">section</a> for the additional information on how JAX-RS JAXB-based providers can be configured.</p><h2 id="SecuringCXFServices-Multiparts">Multiparts</h2><p>The "org.apache.cxf.io.CachedOutputStream.MaxSize" system property or "attachment-max-size" per-endpoint contextual property can be used to control the size of large attachments. When the limits is reached, the error is returned. JAX-WS consumers will receive 500, JAX-RS/HTTP consumers: 413.</p><h1 id="SecuringCXFServices-Lar
 gedatastreamcaching">Large data stream caching</h1><p>A large stream based message or data will be cached in a temporary file. In default, this caching occurs at data size larger than 64K bytes and a temporary file is written in the system's temporary directory. You can change this behavior and other properties of the caching feature by explicitly setting the following properties.</p><p>To change the default behavior for the entire system, you can set the following system properties.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.Threshold</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The threshold value in bytes to switch from memory to file caching. Note that if you are using attachments, the value (or default v
 alue) set for the "<code class="java string">attachment-memory-threshold</code>" property will override this value.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.MaxSize</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The data size in bytes to limit the maximum data size to be cached</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.OutputDirectory</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The directory name for storing the temporary files</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.CipherTransformation</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The cipher transformation name for encrypting the cached content</p></td></tr></tbody></table></div><p>To change the default behavior for a specific bus, you can set the corresponding bus.io.CachedOutputStream properties
  (e.g., bus.io.CachedOutputStream.Threshold for org.apache.cxf.io.CachedOutputStream.Threshold).</p><p>The encryption option, which is available from CXF 2.6.4 and 2.7.1, uses a symmetric encryption using a generated key and it can be used to protect the cached content from unauthorized access. To enable encryption, the CipherTransformation property can be set to the name of an appropriate stream or 8-bit block cipher transformation (e.g., RC4, AES/CTR/NoPadding, etc) that is supported by the environment. However, it is noted that enabling the encryption will result in an increased processing time and it is therefore recommended only in specific use cases where other means to protect the cached content is unavailable.</p></div>
+</div></div><p>When one of the limits is reached, the error is returned. JAX-WS consumers will receive 500, JAX-RS/HTTP consumers: 413.</p><p>The following system properties can also be set up for JAX-WS endpoints: "org.apache.cxf.staxutils.innerElementCountThreshold" and "org.apache.cxf.staxutils.innerElementLevelThreshold".</p><p>Please check this <a shape="rect" href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Data+Bindings#JAX-RSDataBindings-ControllingLargeJAXBXMLandJSONinputpayloads">section</a> for the additional information on how JAX-RS JAXB-based providers can be configured.</p><h2 id="SecuringCXFServices-Multiparts">Multiparts</h2><p>It's possible to control various properties associated with caching large attachments via the following per-endpoint contextual properties:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property Name</p></th><th colspan="1" rowspan="1" class="confluenc
 eTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>attachment-memory-threshold</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The threshold value in bytes to switch from memory to file caching. The default value is 1024K.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>attachment-max-size</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The data size in bytes to limit the maximum data size to be cached. Since CXF 3.0.16, 3.1.14, 3.2.1.</p><p>No max size is set by default. When the limits is reached, the error is returned. JAX-WS consumers will receive 500, JAX-RS/HTTP consumers: 413.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>attachment-directory</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The directory name for storing the temporary files. None is specified by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>attachment-max-header-size</
 p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum MIME Header Length. The default is 300. This value can also be set by the system property "org.apache.cxf.attachment-max-header-size".</p></td></tr></tbody></table></div><p>If no per-endpoint contextual properties are specified, then CXF checks any values that are set for the corresponding System properties listed below for large data stream caching and re-uses them for caching attachments.</p><h1 id="SecuringCXFServices-Largedatastreamcaching">Large data stream caching</h1><p>A large stream based message or data will be cached in a temporary file, which is written in the system's temporary directory. You can change this behavior and other properties of the caching feature by explicitly setting the following properties.</p><p>To change the default behavior for the entire system, you can set the following system properties.</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspa
 n="1" class="confluenceTh"><p>Property Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.Threshold</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The threshold value in bytes to switch from memory to file caching. The default value is 128K for CachedOutputStream and 64K for CachedWriter.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.MaxSize</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The data size in bytes to limit the maximum data size to be cached. No max size is set by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.OutputDirectory</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The directory name for storing the temporary files. None is specified by default.</p></td></tr><tr><td colspan="1
 " rowspan="1" class="confluenceTd"><p>org.apache.cxf.io.CachedOutputStream.CipherTransformation</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The cipher transformation name for encrypting the cached content. None is specified by default.</p></td></tr></tbody></table></div><p>To change the default behavior for a specific bus, you can set the corresponding bus.io.CachedOutputStream properties (e.g., bus.io.CachedOutputStream.Threshold for org.apache.cxf.io.CachedOutputStream.Threshold).</p><p>The encryption option, which is available from CXF 2.6.4 and 2.7.1, uses a symmetric encryption using a generated key and it can be used to protect the cached content from unauthorized access. To enable encryption, the CipherTransformation property can be set to the name of an appropriate stream or 8-bit block cipher transformation (e.g., RC4, AES/CTR/NoPadding, etc) that is supported by the environment. However, it is noted that enabling the encryption will result in an increased p
 rocessing time and it is therefore recommended only in specific use cases where other means to protect the cached content is unavailable.</p></div>
            </div>
            <!-- Content -->
          </td>