camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Base64
Date Fri, 15 Feb 2013 14:57:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Base64">Base64</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h3. Dependencies <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">This
data format is provided in *camel-base64* component. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">To
use Base64 in your Camel routes you need to add a dependency on *camel-base64* which implements
this data format.  <br> <br>If you use Maven you can just add the following to
your pom.xml, substituting the version number for the latest &amp; greatest release (see
[the download page for the latest versions|Download]). <br> <br>{code:xml} <br>&lt;dependency&gt;
<br>  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt; <br>  &lt;artifactId&gt;camel-base64&lt;/artifactId&gt;
<br>  &lt;version&gt;2.11.0&lt;/version&gt; <br>&lt;/dependency&gt;
<br>{code} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Base64-Base64DataFormat"></a>Base64 Data Format</h2>
<p><b>Available as of Camel 2.11</b><br/>
The Base64 <a href="/confluence/display/CAMEL/Data+Format" title="Data Format">Data
Format</a> is a data format for <a href="http://en.wikipedia.org/wiki/Base64" class="external-link"
rel="nofollow">base64 encoding and decoding</a>.</p>

<h3><a name="Base64-Options"></a>Options</h3>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Option </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> lineLength </td>
<td class='confluenceTd'> 76 </td>
<td class='confluenceTd'> To specific a maximum line length for the encoded data. </td>
</tr>
<tr>
<td class='confluenceTd'> lineSeparator </td>
<td class='confluenceTd'> \r\n </td>
<td class='confluenceTd'> The line separators to use. </td>
</tr>
<tr>
<td class='confluenceTd'> urlSafe </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Instead of emitting '+' and '/' we emit '-' and '_' respectively.
urlSafe is only applied to encode operations. Decoding seamlessly handles both modes. </td>
</tr>
</tbody></table>
</div>



<h3><a name="Base64-Marshal"></a>Marshal</h3>
<p>In this example we marshal the file content to base64 object.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"file:<span class="code-comment">//data.bin"</span>).marshal().base64().to(<span
class="code-quote">"jms://myqueue"</span>);</span>
</pre>
</div></div>

<h3><a name="Base64-Unmarshal"></a>Unmarshal</h3>
<p>In this example we unmarshal the payload from the JMS queue to a byte[] object, before
its processed by the newOrder processor. </p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"jms:<span class="code-comment">//queue/order"</span>).unmarshal().base64().processRef(<span
class="code-quote">"newOrder"</span>);</span>
</pre>
</div></div>

<h3><a name="Base64-Dependencies"></a>Dependencies</h3>

<p>To use Base64 in your Camel routes you need to add a dependency on <b>camel-base64</b>
which implements this data format. </p>

<p>If you use Maven you can just add the following to your pom.xml, substituting the
version number for the latest &amp; greatest release (see <a href="/confluence/display/CAMEL/Download"
title="Download">the download page for the latest versions</a>).</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
  <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
  <span class="code-tag">&lt;artifactId&gt;</span>camel-base64<span
class="code-tag">&lt;/artifactId&gt;</span>
  <span class="code-tag">&lt;version&gt;</span>2.11.0<span class="code-tag">&lt;/version&gt;</span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Base64">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=30753853&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Base64?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message