XZUtils.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!-- NewPage -->
  3. <html lang="de">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>XZUtils (Apache Commons Compress 1.13 API)</title>
  7. <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
  8. </head>
  9. <body>
  10. <script type="text/javascript"><!--
  11. try {
  12. if (location.href.indexOf('is-external=true') == -1) {
  13. parent.document.title="XZUtils (Apache Commons Compress 1.13 API)";
  14. }
  15. }
  16. catch(err) {
  17. }
  18. //-->
  19. </script>
  20. <noscript>
  21. <div>JavaScript is disabled on your browser.</div>
  22. </noscript>
  23. <!-- ========= START OF TOP NAVBAR ======= -->
  24. <div class="topNav"><a name="navbar_top">
  25. <!-- -->
  26. </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
  27. <!-- -->
  28. </a>
  29. <ul class="navList" title="Navigation">
  30. <li><a href="../../../../../../overview-summary.html">Overview</a></li>
  31. <li><a href="package-summary.html">Package</a></li>
  32. <li class="navBarCell1Rev">Class</li>
  33. <li><a href="class-use/XZUtils.html">Use</a></li>
  34. <li><a href="package-tree.html">Tree</a></li>
  35. <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
  36. <li><a href="../../../../../../index-all.html">Index</a></li>
  37. <li><a href="../../../../../../help-doc.html">Help</a></li>
  38. </ul>
  39. </div>
  40. <div class="subNav">
  41. <ul class="navList">
  42. <li><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.html" title="class in org.apache.commons.compress.compressors.xz"><span class="strong">Prev Class</span></a></li>
  43. <li>Next Class</li>
  44. </ul>
  45. <ul class="navList">
  46. <li><a href="../../../../../../index.html?org/apache/commons/compress/compressors/xz/XZUtils.html" target="_top">Frames</a></li>
  47. <li><a href="XZUtils.html" target="_top">No Frames</a></li>
  48. </ul>
  49. <ul class="navList" id="allclasses_navbar_top">
  50. <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
  51. </ul>
  52. <div>
  53. <script type="text/javascript"><!--
  54. allClassesLink = document.getElementById("allclasses_navbar_top");
  55. if(window==top) {
  56. allClassesLink.style.display = "block";
  57. }
  58. else {
  59. allClassesLink.style.display = "none";
  60. }
  61. //-->
  62. </script>
  63. </div>
  64. <div>
  65. <ul class="subNavList">
  66. <li>Summary:&nbsp;</li>
  67. <li>Nested&nbsp;|&nbsp;</li>
  68. <li>Field&nbsp;|&nbsp;</li>
  69. <li>Constr&nbsp;|&nbsp;</li>
  70. <li><a href="#method_summary">Method</a></li>
  71. </ul>
  72. <ul class="subNavList">
  73. <li>Detail:&nbsp;</li>
  74. <li>Field&nbsp;|&nbsp;</li>
  75. <li>Constr&nbsp;|&nbsp;</li>
  76. <li><a href="#method_detail">Method</a></li>
  77. </ul>
  78. </div>
  79. <a name="skip-navbar_top">
  80. <!-- -->
  81. </a></div>
  82. <!-- ========= END OF TOP NAVBAR ========= -->
  83. <!-- ======== START OF CLASS DATA ======== -->
  84. <div class="header">
  85. <div class="subTitle">org.apache.commons.compress.compressors.xz</div>
  86. <h2 title="Class XZUtils" class="title">Class XZUtils</h2>
  87. </div>
  88. <div class="contentContainer">
  89. <ul class="inheritance">
  90. <li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
  91. <li>
  92. <ul class="inheritance">
  93. <li>org.apache.commons.compress.compressors.xz.XZUtils</li>
  94. </ul>
  95. </li>
  96. </ul>
  97. <div class="description">
  98. <ul class="blockList">
  99. <li class="blockList">
  100. <hr>
  101. <br>
  102. <pre>public class <a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.30">XZUtils</a>
  103. extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
  104. <div class="block">Utility code for the xz compression format.</div>
  105. <dl><dt><span class="strong">Since:</span></dt>
  106. <dd>1.4</dd>
  107. <dt><span class="strong">This class is thread-safe</span></dt>
  108. <dd></dd></dl>
  109. </li>
  110. </ul>
  111. </div>
  112. <div class="summary">
  113. <ul class="blockList">
  114. <li class="blockList">
  115. <!-- ========== METHOD SUMMARY =========== -->
  116. <ul class="blockList">
  117. <li class="blockList"><a name="method_summary">
  118. <!-- -->
  119. </a>
  120. <h3>Method Summary</h3>
  121. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  122. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  123. <tr>
  124. <th class="colFirst" scope="col">Modifier and Type</th>
  125. <th class="colLast" scope="col">Method and Description</th>
  126. </tr>
  127. <tr class="altColor">
  128. <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  129. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#getCompressedFilename(java.lang.String)">getCompressedFilename</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
  130. <div class="block">Maps the given filename to the name that the file should have after
  131. compression with xz.</div>
  132. </td>
  133. </tr>
  134. <tr class="rowColor">
  135. <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
  136. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#getUncompressedFilename(java.lang.String)">getUncompressedFilename</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
  137. <div class="block">Maps the given name of a xz-compressed file to the name that the
  138. file should have after uncompression.</div>
  139. </td>
  140. </tr>
  141. <tr class="altColor">
  142. <td class="colFirst"><code>static boolean</code></td>
  143. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#isCompressedFilename(java.lang.String)">isCompressedFilename</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
  144. <div class="block">Detects common xz suffixes in the given filename.</div>
  145. </td>
  146. </tr>
  147. <tr class="rowColor">
  148. <td class="colFirst"><code>static boolean</code></td>
  149. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#isXZCompressionAvailable()">isXZCompressionAvailable</a></strong>()</code>
  150. <div class="block">Are the classes required to support XZ compression available?</div>
  151. </td>
  152. </tr>
  153. <tr class="altColor">
  154. <td class="colFirst"><code>static boolean</code></td>
  155. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#matches(byte[],%20int)">matches</a></strong>(byte[]&nbsp;signature,
  156. int&nbsp;length)</code>
  157. <div class="block">Checks if the signature matches what is expected for a .xz file.</div>
  158. </td>
  159. </tr>
  160. <tr class="rowColor">
  161. <td class="colFirst"><code>static void</code></td>
  162. <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZUtils.html#setCacheXZAvailablity(boolean)">setCacheXZAvailablity</a></strong>(boolean&nbsp;doCache)</code>
  163. <div class="block">Whether to cache the result of the XZ for Java check.</div>
  164. </td>
  165. </tr>
  166. </table>
  167. <ul class="blockList">
  168. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  169. <!-- -->
  170. </a>
  171. <h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
  172. <code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
  173. </ul>
  174. </li>
  175. </ul>
  176. </li>
  177. </ul>
  178. </div>
  179. <div class="details">
  180. <ul class="blockList">
  181. <li class="blockList">
  182. <!-- ============ METHOD DETAIL ========== -->
  183. <ul class="blockList">
  184. <li class="blockList"><a name="method_detail">
  185. <!-- -->
  186. </a>
  187. <h3>Method Detail</h3>
  188. <a name="matches(byte[], int)">
  189. <!-- -->
  190. </a>
  191. <ul class="blockList">
  192. <li class="blockList">
  193. <h4>matches</h4>
  194. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.80">matches</a>(byte[]&nbsp;signature,
  195. int&nbsp;length)</pre>
  196. <div class="block">Checks if the signature matches what is expected for a .xz file.
  197. <p>This is more or less a copy of the version found in <a href="../../../../../../org/apache/commons/compress/compressors/xz/XZCompressorInputStream.html" title="class in org.apache.commons.compress.compressors.xz"><code>XZCompressorInputStream</code></a> but doesn't depend on the presence of
  198. XZ for Java.</p></div>
  199. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>signature</code> - the bytes to check</dd><dd><code>length</code> - the number of bytes to check</dd>
  200. <dt><span class="strong">Returns:</span></dt><dd>true if signature matches the .xz magic bytes, false otherwise</dd><dt><span class="strong">Since:</span></dt>
  201. <dd>1.9</dd></dl>
  202. </li>
  203. </ul>
  204. <a name="isXZCompressionAvailable()">
  205. <!-- -->
  206. </a>
  207. <ul class="blockList">
  208. <li class="blockList">
  209. <h4>isXZCompressionAvailable</h4>
  210. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.99">isXZCompressionAvailable</a>()</pre>
  211. <div class="block">Are the classes required to support XZ compression available?</div>
  212. <dl><dt><span class="strong">Returns:</span></dt><dd>true if the classes required to support XZ compression are available</dd><dt><span class="strong">Since:</span></dt>
  213. <dd>1.5</dd></dl>
  214. </li>
  215. </ul>
  216. <a name="isCompressedFilename(java.lang.String)">
  217. <!-- -->
  218. </a>
  219. <ul class="blockList">
  220. <li class="blockList">
  221. <h4>isCompressedFilename</h4>
  222. <pre>public static&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.123">isCompressedFilename</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</pre>
  223. <div class="block">Detects common xz suffixes in the given filename.</div>
  224. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  225. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the filename has a common xz suffix,
  226. <code>false</code> otherwise</dd></dl>
  227. </li>
  228. </ul>
  229. <a name="getUncompressedFilename(java.lang.String)">
  230. <!-- -->
  231. </a>
  232. <ul class="blockList">
  233. <li class="blockList">
  234. <h4>getUncompressedFilename</h4>
  235. <pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.140">getUncompressedFilename</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</pre>
  236. <div class="block">Maps the given name of a xz-compressed file to the name that the
  237. file should have after uncompression. Commonly used file type specific
  238. suffixes like ".txz" are automatically detected and
  239. correctly mapped. For example the name "package.txz" is mapped to
  240. "package.tar". And any filenames with the generic ".xz" suffix
  241. (or any other generic xz suffix) is mapped to a name without that
  242. suffix. If no xz suffix is detected, then the filename is returned
  243. unmapped.</div>
  244. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  245. <dt><span class="strong">Returns:</span></dt><dd>name of the corresponding uncompressed file</dd></dl>
  246. </li>
  247. </ul>
  248. <a name="getCompressedFilename(java.lang.String)">
  249. <!-- -->
  250. </a>
  251. <ul class="blockList">
  252. <li class="blockList">
  253. <h4>getCompressedFilename</h4>
  254. <pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.155">getCompressedFilename</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</pre>
  255. <div class="block">Maps the given filename to the name that the file should have after
  256. compression with xz. Common file types with custom suffixes for
  257. compressed versions are automatically detected and correctly mapped.
  258. For example the name "package.tar" is mapped to "package.txz". If no
  259. custom mapping is applicable, then the default ".xz" suffix is appended
  260. to the filename.</div>
  261. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  262. <dt><span class="strong">Returns:</span></dt><dd>name of the corresponding compressed file</dd></dl>
  263. </li>
  264. </ul>
  265. <a name="setCacheXZAvailablity(boolean)">
  266. <!-- -->
  267. </a>
  268. <ul class="blockListLast">
  269. <li class="blockList">
  270. <h4>setCacheXZAvailablity</h4>
  271. <pre>public static&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/commons/compress/compressors/xz/XZUtils.html#line.166">setCacheXZAvailablity</a>(boolean&nbsp;doCache)</pre>
  272. <div class="block">Whether to cache the result of the XZ for Java check.
  273. <p>This defaults to <code>false</code> in an OSGi environment and <code>true</code> otherwise.</p></div>
  274. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>doCache</code> - whether to cache the result</dd><dt><span class="strong">Since:</span></dt>
  275. <dd>1.9</dd></dl>
  276. </li>
  277. </ul>
  278. </li>
  279. </ul>
  280. </li>
  281. </ul>
  282. </div>
  283. </div>
  284. <!-- ========= END OF CLASS DATA ========= -->
  285. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  286. <div class="bottomNav"><a name="navbar_bottom">
  287. <!-- -->
  288. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  289. <!-- -->
  290. </a>
  291. <ul class="navList" title="Navigation">
  292. <li><a href="../../../../../../overview-summary.html">Overview</a></li>
  293. <li><a href="package-summary.html">Package</a></li>
  294. <li class="navBarCell1Rev">Class</li>
  295. <li><a href="class-use/XZUtils.html">Use</a></li>
  296. <li><a href="package-tree.html">Tree</a></li>
  297. <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
  298. <li><a href="../../../../../../index-all.html">Index</a></li>
  299. <li><a href="../../../../../../help-doc.html">Help</a></li>
  300. </ul>
  301. </div>
  302. <div class="subNav">
  303. <ul class="navList">
  304. <li><a href="../../../../../../org/apache/commons/compress/compressors/xz/XZCompressorOutputStream.html" title="class in org.apache.commons.compress.compressors.xz"><span class="strong">Prev Class</span></a></li>
  305. <li>Next Class</li>
  306. </ul>
  307. <ul class="navList">
  308. <li><a href="../../../../../../index.html?org/apache/commons/compress/compressors/xz/XZUtils.html" target="_top">Frames</a></li>
  309. <li><a href="XZUtils.html" target="_top">No Frames</a></li>
  310. </ul>
  311. <ul class="navList" id="allclasses_navbar_bottom">
  312. <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
  313. </ul>
  314. <div>
  315. <script type="text/javascript"><!--
  316. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  317. if(window==top) {
  318. allClassesLink.style.display = "block";
  319. }
  320. else {
  321. allClassesLink.style.display = "none";
  322. }
  323. //-->
  324. </script>
  325. </div>
  326. <div>
  327. <ul class="subNavList">
  328. <li>Summary:&nbsp;</li>
  329. <li>Nested&nbsp;|&nbsp;</li>
  330. <li>Field&nbsp;|&nbsp;</li>
  331. <li>Constr&nbsp;|&nbsp;</li>
  332. <li><a href="#method_summary">Method</a></li>
  333. </ul>
  334. <ul class="subNavList">
  335. <li>Detail:&nbsp;</li>
  336. <li>Field&nbsp;|&nbsp;</li>
  337. <li>Constr&nbsp;|&nbsp;</li>
  338. <li><a href="#method_detail">Method</a></li>
  339. </ul>
  340. </div>
  341. <a name="skip-navbar_bottom">
  342. <!-- -->
  343. </a></div>
  344. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  345. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  346. </body>
  347. </html>