FileNameUtil.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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>FileNameUtil (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="FileNameUtil (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/FileNameUtil.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/CompressorStreamProvider.html" title="interface in org.apache.commons.compress.compressors"><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/FileNameUtil.html" target="_top">Frames</a></li>
  47. <li><a href="FileNameUtil.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><a href="#constructor_summary">Constr</a>&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><a href="#constructor_detail">Constr</a>&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</div>
  86. <h2 title="Class FileNameUtil" class="title">Class FileNameUtil</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.FileNameUtil</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/FileNameUtil.html#line.31">FileNameUtil</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">File name mapping code for the compression formats.</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. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  116. <ul class="blockList">
  117. <li class="blockList"><a name="constructor_summary">
  118. <!-- -->
  119. </a>
  120. <h3>Constructor Summary</h3>
  121. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  122. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  123. <tr>
  124. <th class="colOne" scope="col">Constructor and Description</th>
  125. </tr>
  126. <tr class="altColor">
  127. <td class="colOne"><code><strong><a href="../../../../../org/apache/commons/compress/compressors/FileNameUtil.html#FileNameUtil(java.util.Map,%20java.lang.String)">FileNameUtil</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;uncompressSuffix,
  128. <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;defaultExtension)</code>
  129. <div class="block">sets up the utility with a map of known compressed to
  130. uncompressed suffix mappings and the default extension of the
  131. format.</div>
  132. </td>
  133. </tr>
  134. </table>
  135. </li>
  136. </ul>
  137. <!-- ========== METHOD SUMMARY =========== -->
  138. <ul class="blockList">
  139. <li class="blockList"><a name="method_summary">
  140. <!-- -->
  141. </a>
  142. <h3>Method Summary</h3>
  143. <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  144. <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
  145. <tr>
  146. <th class="colFirst" scope="col">Modifier and Type</th>
  147. <th class="colLast" scope="col">Method and Description</th>
  148. </tr>
  149. <tr class="altColor">
  150. <td class="colFirst"><code><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>
  151. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/compressors/FileNameUtil.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>
  152. <div class="block">Maps the given filename to the name that the file should have after
  153. compression.</div>
  154. </td>
  155. </tr>
  156. <tr class="rowColor">
  157. <td class="colFirst"><code><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>
  158. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/compressors/FileNameUtil.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>
  159. <div class="block">Maps the given name of a compressed file to the name that the
  160. file should have after uncompression.</div>
  161. </td>
  162. </tr>
  163. <tr class="altColor">
  164. <td class="colFirst"><code>boolean</code></td>
  165. <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/compress/compressors/FileNameUtil.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>
  166. <div class="block">Detects common format suffixes in the given filename.</div>
  167. </td>
  168. </tr>
  169. </table>
  170. <ul class="blockList">
  171. <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
  172. <!-- -->
  173. </a>
  174. <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>
  175. <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>
  176. </ul>
  177. </li>
  178. </ul>
  179. </li>
  180. </ul>
  181. </div>
  182. <div class="details">
  183. <ul class="blockList">
  184. <li class="blockList">
  185. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  186. <ul class="blockList">
  187. <li class="blockList"><a name="constructor_detail">
  188. <!-- -->
  189. </a>
  190. <h3>Constructor Detail</h3>
  191. <a name="FileNameUtil(java.util.Map, java.lang.String)">
  192. <!-- -->
  193. </a>
  194. <ul class="blockListLast">
  195. <li class="blockList">
  196. <h4>FileNameUtil</h4>
  197. <pre>public&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/compressors/FileNameUtil.html#line.91">FileNameUtil</a>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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>,<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>&gt;&nbsp;uncompressSuffix,
  198. <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;defaultExtension)</pre>
  199. <div class="block">sets up the utility with a map of known compressed to
  200. uncompressed suffix mappings and the default extension of the
  201. format.</div>
  202. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>uncompressSuffix</code> - Map from common filename suffixes of
  203. compressed files to the corresponding suffixes of uncompressed
  204. files. For example: from ".tgz" to ".tar". This map also
  205. contains format-specific suffixes like ".gz" and "-z". These
  206. suffixes are mapped to the empty string, as they should simply
  207. be removed from the filename when the file is uncompressed.</dd><dd><code>defaultExtension</code> - the format's default extension like ".gz"</dd></dl>
  208. </li>
  209. </ul>
  210. </li>
  211. </ul>
  212. <!-- ============ METHOD DETAIL ========== -->
  213. <ul class="blockList">
  214. <li class="blockList"><a name="method_detail">
  215. <!-- -->
  216. </a>
  217. <h3>Method Detail</h3>
  218. <a name="isCompressedFilename(java.lang.String)">
  219. <!-- -->
  220. </a>
  221. <ul class="blockList">
  222. <li class="blockList">
  223. <h4>isCompressedFilename</h4>
  224. <pre>public&nbsp;boolean&nbsp;<a href="../../../../../src-html/org/apache/commons/compress/compressors/FileNameUtil.html#line.133">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>
  225. <div class="block">Detects common format suffixes in the given filename.</div>
  226. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  227. <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the filename has a common format suffix,
  228. <code>false</code> otherwise</dd></dl>
  229. </li>
  230. </ul>
  231. <a name="getUncompressedFilename(java.lang.String)">
  232. <!-- -->
  233. </a>
  234. <ul class="blockList">
  235. <li class="blockList">
  236. <h4>getUncompressedFilename</h4>
  237. <pre>public&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/FileNameUtil.html#line.158">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>
  238. <div class="block">Maps the given name of a compressed file to the name that the
  239. file should have after uncompression. Commonly used file type specific
  240. suffixes like ".tgz" or ".svgz" are automatically detected and
  241. correctly mapped. For example the name "package.tgz" is mapped to
  242. "package.tar". And any filenames with the generic ".gz" suffix
  243. (or any other generic gzip suffix) is mapped to a name without that
  244. suffix. If no format suffix is detected, then the filename is returned
  245. unmapped.</div>
  246. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  247. <dt><span class="strong">Returns:</span></dt><dd>name of the corresponding uncompressed file</dd></dl>
  248. </li>
  249. </ul>
  250. <a name="getCompressedFilename(java.lang.String)">
  251. <!-- -->
  252. </a>
  253. <ul class="blockListLast">
  254. <li class="blockList">
  255. <h4>getCompressedFilename</h4>
  256. <pre>public&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/FileNameUtil.html#line.182">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>
  257. <div class="block">Maps the given filename to the name that the file should have after
  258. compression. Common file types with custom suffixes for
  259. compressed versions are automatically detected and correctly mapped.
  260. For example the name "package.tar" is mapped to "package.tgz". If no
  261. custom mapping is applicable, then the default ".gz" suffix is appended
  262. to the filename.</div>
  263. <dl><dt><span class="strong">Parameters:</span></dt><dd><code>filename</code> - name of a file</dd>
  264. <dt><span class="strong">Returns:</span></dt><dd>name of the corresponding compressed file</dd></dl>
  265. </li>
  266. </ul>
  267. </li>
  268. </ul>
  269. </li>
  270. </ul>
  271. </div>
  272. </div>
  273. <!-- ========= END OF CLASS DATA ========= -->
  274. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  275. <div class="bottomNav"><a name="navbar_bottom">
  276. <!-- -->
  277. </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
  278. <!-- -->
  279. </a>
  280. <ul class="navList" title="Navigation">
  281. <li><a href="../../../../../overview-summary.html">Overview</a></li>
  282. <li><a href="package-summary.html">Package</a></li>
  283. <li class="navBarCell1Rev">Class</li>
  284. <li><a href="class-use/FileNameUtil.html">Use</a></li>
  285. <li><a href="package-tree.html">Tree</a></li>
  286. <li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
  287. <li><a href="../../../../../index-all.html">Index</a></li>
  288. <li><a href="../../../../../help-doc.html">Help</a></li>
  289. </ul>
  290. </div>
  291. <div class="subNav">
  292. <ul class="navList">
  293. <li><a href="../../../../../org/apache/commons/compress/compressors/CompressorStreamProvider.html" title="interface in org.apache.commons.compress.compressors"><span class="strong">Prev Class</span></a></li>
  294. <li>Next Class</li>
  295. </ul>
  296. <ul class="navList">
  297. <li><a href="../../../../../index.html?org/apache/commons/compress/compressors/FileNameUtil.html" target="_top">Frames</a></li>
  298. <li><a href="FileNameUtil.html" target="_top">No Frames</a></li>
  299. </ul>
  300. <ul class="navList" id="allclasses_navbar_bottom">
  301. <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
  302. </ul>
  303. <div>
  304. <script type="text/javascript"><!--
  305. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  306. if(window==top) {
  307. allClassesLink.style.display = "block";
  308. }
  309. else {
  310. allClassesLink.style.display = "none";
  311. }
  312. //-->
  313. </script>
  314. </div>
  315. <div>
  316. <ul class="subNavList">
  317. <li>Summary:&nbsp;</li>
  318. <li>Nested&nbsp;|&nbsp;</li>
  319. <li>Field&nbsp;|&nbsp;</li>
  320. <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
  321. <li><a href="#method_summary">Method</a></li>
  322. </ul>
  323. <ul class="subNavList">
  324. <li>Detail:&nbsp;</li>
  325. <li>Field&nbsp;|&nbsp;</li>
  326. <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
  327. <li><a href="#method_detail">Method</a></li>
  328. </ul>
  329. </div>
  330. <a name="skip-navbar_bottom">
  331. <!-- -->
  332. </a></div>
  333. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  334. <p class="legalCopy"><small>Copyright &#169; 2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  335. </body>
  336. </html>