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:55: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>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
         <br/>
    <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>This data format is provided in <b>camel-base64</b> component.</p>
    </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/display/CAMEL/Base64?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message