FilenameUtils.html 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617
  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. <!-- Generated by javadoc -->
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <title>FilenameUtils (Apache Commons IO 2.6 API)</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
  9. <script type="text/javascript" src="../../../../script.js"></script>
  10. </head>
  11. <body>
  12. <script type="text/javascript"><!--
  13. try {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="FilenameUtils (Apache Commons IO 2.6 API)";
  16. }
  17. }
  18. catch(err) {
  19. }
  20. //-->
  21. var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9,"i21":9,"i22":9,"i23":9,"i24":9,"i25":9,"i26":9,"i27":9,"i28":9,"i29":9,"i30":9,"i31":9};
  22. var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
  23. var altColor = "altColor";
  24. var rowColor = "rowColor";
  25. var tableTab = "tableTab";
  26. var activeTableTab = "activeTableTab";
  27. </script>
  28. <noscript>
  29. <div>JavaScript is disabled on your browser.</div>
  30. </noscript>
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="topNav"><a name="navbar.top">
  33. <!-- -->
  34. </a>
  35. <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
  36. <a name="navbar.top.firstrow">
  37. <!-- -->
  38. </a>
  39. <ul class="navList" title="Navigation">
  40. <li><a href="../../../../overview-summary.html">Overview</a></li>
  41. <li><a href="package-summary.html">Package</a></li>
  42. <li class="navBarCell1Rev">Class</li>
  43. <li><a href="class-use/FilenameUtils.html">Use</a></li>
  44. <li><a href="package-tree.html">Tree</a></li>
  45. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  46. <li><a href="../../../../index-all.html">Index</a></li>
  47. <li><a href="../../../../help-doc.html">Help</a></li>
  48. </ul>
  49. </div>
  50. <div class="subNav">
  51. <ul class="navList">
  52. <li><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  53. <li><a href="../../../../org/apache/commons/io/FileSystemUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  54. </ul>
  55. <ul class="navList">
  56. <li><a href="../../../../index.html?org/apache/commons/io/FilenameUtils.html" target="_top">Frames</a></li>
  57. <li><a href="FilenameUtils.html" target="_top">No&nbsp;Frames</a></li>
  58. </ul>
  59. <ul class="navList" id="allclasses_navbar_top">
  60. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  61. </ul>
  62. <div>
  63. <script type="text/javascript"><!--
  64. allClassesLink = document.getElementById("allclasses_navbar_top");
  65. if(window==top) {
  66. allClassesLink.style.display = "block";
  67. }
  68. else {
  69. allClassesLink.style.display = "none";
  70. }
  71. //-->
  72. </script>
  73. </div>
  74. <div>
  75. <ul class="subNavList">
  76. <li>Summary:&nbsp;</li>
  77. <li>Nested&nbsp;|&nbsp;</li>
  78. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  79. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  80. <li><a href="#method.summary">Method</a></li>
  81. </ul>
  82. <ul class="subNavList">
  83. <li>Detail:&nbsp;</li>
  84. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  85. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  86. <li><a href="#method.detail">Method</a></li>
  87. </ul>
  88. </div>
  89. <a name="skip.navbar.top">
  90. <!-- -->
  91. </a></div>
  92. <!-- ========= END OF TOP NAVBAR ========= -->
  93. <!-- ======== START OF CLASS DATA ======== -->
  94. <div class="header">
  95. <div class="subTitle">org.apache.commons.io</div>
  96. <h2 title="Class FilenameUtils" class="title">Class FilenameUtils</h2>
  97. </div>
  98. <div class="contentContainer">
  99. <ul class="inheritance">
  100. <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>
  101. <li>
  102. <ul class="inheritance">
  103. <li>org.apache.commons.io.FilenameUtils</li>
  104. </ul>
  105. </li>
  106. </ul>
  107. <div class="description">
  108. <ul class="blockList">
  109. <li class="blockList">
  110. <hr>
  111. <br>
  112. <pre>public class <span class="typeNameLabel">FilenameUtils</span>
  113. 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>
  114. <div class="block">General filename and filepath manipulation utilities.
  115. <p>
  116. When dealing with filenames you can hit problems when moving from a Windows
  117. based development machine to a Unix based production machine.
  118. This class aims to help avoid those problems.
  119. <p>
  120. <b>NOTE</b>: You may be able to avoid using this class entirely simply by
  121. using JDK <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> objects and the two argument constructor
  122. <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#File-java.io.File-java.lang.String-" title="class or interface in java.io"><code>File(File,String)</code></a>.
  123. <p>
  124. Most methods on this class are designed to work the same on both Unix and Windows.
  125. Those that don't include 'System', 'Unix' or 'Windows' in their name.
  126. <p>
  127. Most methods recognise both separators (forward and back), and both
  128. sets of prefixes. See the javadoc of each method for details.
  129. <p>
  130. This class defines six components within a filename
  131. (example C:\dev\project\file.txt):
  132. <ul>
  133. <li>the prefix - C:\</li>
  134. <li>the path - dev\project\</li>
  135. <li>the full path - C:\dev\project\</li>
  136. <li>the name - file.txt</li>
  137. <li>the base name - file</li>
  138. <li>the extension - txt</li>
  139. </ul>
  140. Note that this class works best if directory filenames end with a separator.
  141. If you omit the last separator, it is impossible to determine if the filename
  142. corresponds to a file or a directory. As a result, we have chosen to say
  143. it corresponds to a file.
  144. <p>
  145. This class only supports Unix and Windows style names.
  146. Prefixes are matched as follows:
  147. <pre>
  148. Windows:
  149. a\b\c.txt --&gt; "" --&gt; relative
  150. \a\b\c.txt --&gt; "\" --&gt; current drive absolute
  151. C:a\b\c.txt --&gt; "C:" --&gt; drive relative
  152. C:\a\b\c.txt --&gt; "C:\" --&gt; absolute
  153. \\server\a\b\c.txt --&gt; "\\server\" --&gt; UNC
  154. Unix:
  155. a/b/c.txt --&gt; "" --&gt; relative
  156. /a/b/c.txt --&gt; "/" --&gt; absolute
  157. ~/a/b/c.txt --&gt; "~/" --&gt; current user
  158. ~ --&gt; "~/" --&gt; current user (slash added)
  159. ~user/a/b/c.txt --&gt; "~user/" --&gt; named user
  160. ~user --&gt; "~user/" --&gt; named user (slash added)
  161. </pre>
  162. Both prefix styles are matched always, irrespective of the machine that you are
  163. currently running on.
  164. <p>
  165. Origin of code: Excalibur, Alexandria, Tomcat, Commons-Utils.</div>
  166. <dl>
  167. <dt><span class="simpleTagLabel">Since:</span></dt>
  168. <dd>1.1</dd>
  169. </dl>
  170. </li>
  171. </ul>
  172. </div>
  173. <div class="summary">
  174. <ul class="blockList">
  175. <li class="blockList">
  176. <!-- =========== FIELD SUMMARY =========== -->
  177. <ul class="blockList">
  178. <li class="blockList"><a name="field.summary">
  179. <!-- -->
  180. </a>
  181. <h3>Field Summary</h3>
  182. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
  183. <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
  184. <tr>
  185. <th class="colFirst" scope="col">Modifier and Type</th>
  186. <th class="colLast" scope="col">Field and Description</th>
  187. </tr>
  188. <tr class="altColor">
  189. <td class="colFirst"><code>static char</code></td>
  190. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#EXTENSION_SEPARATOR">EXTENSION_SEPARATOR</a></span></code>
  191. <div class="block">The extension separator character.</div>
  192. </td>
  193. </tr>
  194. <tr class="rowColor">
  195. <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>
  196. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#EXTENSION_SEPARATOR_STR">EXTENSION_SEPARATOR_STR</a></span></code>
  197. <div class="block">The extension separator String.</div>
  198. </td>
  199. </tr>
  200. </table>
  201. </li>
  202. </ul>
  203. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  204. <ul class="blockList">
  205. <li class="blockList"><a name="constructor.summary">
  206. <!-- -->
  207. </a>
  208. <h3>Constructor Summary</h3>
  209. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
  210. <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
  211. <tr>
  212. <th class="colOne" scope="col">Constructor and Description</th>
  213. </tr>
  214. <tr class="altColor">
  215. <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#FilenameUtils--">FilenameUtils</a></span>()</code>
  216. <div class="block">Instances should NOT be constructed in standard programming.</div>
  217. </td>
  218. </tr>
  219. </table>
  220. </li>
  221. </ul>
  222. <!-- ========== METHOD SUMMARY =========== -->
  223. <ul class="blockList">
  224. <li class="blockList"><a name="method.summary">
  225. <!-- -->
  226. </a>
  227. <h3>Method Summary</h3>
  228. <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
  229. <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
  230. <tr>
  231. <th class="colFirst" scope="col">Modifier and Type</th>
  232. <th class="colLast" scope="col">Method and Description</th>
  233. </tr>
  234. <tr id="i0" class="altColor">
  235. <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>
  236. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#concat-java.lang.String-java.lang.String-">concat</a></span>(<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;basePath,
  237. <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;fullFilenameToAdd)</code>
  238. <div class="block">Concatenates a filename to a base path using normal command line style rules.</div>
  239. </td>
  240. </tr>
  241. <tr id="i1" class="rowColor">
  242. <td class="colFirst"><code>static boolean</code></td>
  243. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#directoryContains-java.lang.String-java.lang.String-">directoryContains</a></span>(<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;canonicalParent,
  244. <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;canonicalChild)</code>
  245. <div class="block">Determines whether the <code>parent</code> directory contains the <code>child</code> element (a file or directory).</div>
  246. </td>
  247. </tr>
  248. <tr id="i2" class="altColor">
  249. <td class="colFirst"><code>static boolean</code></td>
  250. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#equals-java.lang.String-java.lang.String-">equals</a></span>(<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;filename1,
  251. <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;filename2)</code>
  252. <div class="block">Checks whether two filenames are equal exactly.</div>
  253. </td>
  254. </tr>
  255. <tr id="i3" class="rowColor">
  256. <td class="colFirst"><code>static boolean</code></td>
  257. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#equals-java.lang.String-java.lang.String-boolean-org.apache.commons.io.IOCase-">equals</a></span>(<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;filename1,
  258. <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;filename2,
  259. boolean&nbsp;normalized,
  260. <a href="../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
  261. <div class="block">Checks whether two filenames are equal, optionally normalizing and providing
  262. control over the case-sensitivity.</div>
  263. </td>
  264. </tr>
  265. <tr id="i4" class="altColor">
  266. <td class="colFirst"><code>static boolean</code></td>
  267. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#equalsNormalized-java.lang.String-java.lang.String-">equalsNormalized</a></span>(<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;filename1,
  268. <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;filename2)</code>
  269. <div class="block">Checks whether two filenames are equal after both have been normalized.</div>
  270. </td>
  271. </tr>
  272. <tr id="i5" class="rowColor">
  273. <td class="colFirst"><code>static boolean</code></td>
  274. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#equalsNormalizedOnSystem-java.lang.String-java.lang.String-">equalsNormalizedOnSystem</a></span>(<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;filename1,
  275. <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;filename2)</code>
  276. <div class="block">Checks whether two filenames are equal after both have been normalized
  277. and using the case rules of the system.</div>
  278. </td>
  279. </tr>
  280. <tr id="i6" class="altColor">
  281. <td class="colFirst"><code>static boolean</code></td>
  282. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#equalsOnSystem-java.lang.String-java.lang.String-">equalsOnSystem</a></span>(<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;filename1,
  283. <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;filename2)</code>
  284. <div class="block">Checks whether two filenames are equal using the case rules of the system.</div>
  285. </td>
  286. </tr>
  287. <tr id="i7" class="rowColor">
  288. <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>
  289. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getBaseName-java.lang.String-">getBaseName</a></span>(<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>
  290. <div class="block">Gets the base name, minus the full path and extension, from a full filename.</div>
  291. </td>
  292. </tr>
  293. <tr id="i8" class="altColor">
  294. <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>
  295. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getExtension-java.lang.String-">getExtension</a></span>(<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>
  296. <div class="block">Gets the extension of a filename.</div>
  297. </td>
  298. </tr>
  299. <tr id="i9" class="rowColor">
  300. <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>
  301. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getFullPath-java.lang.String-">getFullPath</a></span>(<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>
  302. <div class="block">Gets the full path from a full filename, which is the prefix + path.</div>
  303. </td>
  304. </tr>
  305. <tr id="i10" class="altColor">
  306. <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>
  307. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getFullPathNoEndSeparator-java.lang.String-">getFullPathNoEndSeparator</a></span>(<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>
  308. <div class="block">Gets the full path from a full filename, which is the prefix + path,
  309. and also excluding the final directory separator.</div>
  310. </td>
  311. </tr>
  312. <tr id="i11" class="rowColor">
  313. <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>
  314. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getName-java.lang.String-">getName</a></span>(<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>
  315. <div class="block">Gets the name minus the path from a full filename.</div>
  316. </td>
  317. </tr>
  318. <tr id="i12" class="altColor">
  319. <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>
  320. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getPath-java.lang.String-">getPath</a></span>(<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>
  321. <div class="block">Gets the path from a full filename, which excludes the prefix.</div>
  322. </td>
  323. </tr>
  324. <tr id="i13" class="rowColor">
  325. <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>
  326. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getPathNoEndSeparator-java.lang.String-">getPathNoEndSeparator</a></span>(<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>
  327. <div class="block">Gets the path from a full filename, which excludes the prefix, and
  328. also excluding the final directory separator.</div>
  329. </td>
  330. </tr>
  331. <tr id="i14" class="altColor">
  332. <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>
  333. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getPrefix-java.lang.String-">getPrefix</a></span>(<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>
  334. <div class="block">Gets the prefix from a full filename, such as <code>C:/</code>
  335. or <code>~/</code>.</div>
  336. </td>
  337. </tr>
  338. <tr id="i15" class="rowColor">
  339. <td class="colFirst"><code>static int</code></td>
  340. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#getPrefixLength-java.lang.String-">getPrefixLength</a></span>(<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>
  341. <div class="block">Returns the length of the filename prefix, such as <code>C:/</code> or <code>~/</code>.</div>
  342. </td>
  343. </tr>
  344. <tr id="i16" class="altColor">
  345. <td class="colFirst"><code>static int</code></td>
  346. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#indexOfExtension-java.lang.String-">indexOfExtension</a></span>(<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>
  347. <div class="block">Returns the index of the last extension separator character, which is a dot.</div>
  348. </td>
  349. </tr>
  350. <tr id="i17" class="rowColor">
  351. <td class="colFirst"><code>static int</code></td>
  352. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#indexOfLastSeparator-java.lang.String-">indexOfLastSeparator</a></span>(<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>
  353. <div class="block">Returns the index of the last directory separator character.</div>
  354. </td>
  355. </tr>
  356. <tr id="i18" class="altColor">
  357. <td class="colFirst"><code>static boolean</code></td>
  358. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#isExtension-java.lang.String-java.util.Collection-">isExtension</a></span>(<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,
  359. <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</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>&gt;&nbsp;extensions)</code>
  360. <div class="block">Checks whether the extension of the filename is one of those specified.</div>
  361. </td>
  362. </tr>
  363. <tr id="i19" class="rowColor">
  364. <td class="colFirst"><code>static boolean</code></td>
  365. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#isExtension-java.lang.String-java.lang.String-">isExtension</a></span>(<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,
  366. <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;extension)</code>
  367. <div class="block">Checks whether the extension of the filename is that specified.</div>
  368. </td>
  369. </tr>
  370. <tr id="i20" class="altColor">
  371. <td class="colFirst"><code>static boolean</code></td>
  372. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#isExtension-java.lang.String-java.lang.String:A-">isExtension</a></span>(<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,
  373. <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;extensions)</code>
  374. <div class="block">Checks whether the extension of the filename is one of those specified.</div>
  375. </td>
  376. </tr>
  377. <tr id="i21" class="rowColor">
  378. <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>
  379. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#normalize-java.lang.String-">normalize</a></span>(<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>
  380. <div class="block">Normalizes a path, removing double and single dot path steps.</div>
  381. </td>
  382. </tr>
  383. <tr id="i22" class="altColor">
  384. <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>
  385. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#normalize-java.lang.String-boolean-">normalize</a></span>(<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,
  386. boolean&nbsp;unixSeparator)</code>
  387. <div class="block">Normalizes a path, removing double and single dot path steps.</div>
  388. </td>
  389. </tr>
  390. <tr id="i23" class="rowColor">
  391. <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>
  392. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#normalizeNoEndSeparator-java.lang.String-">normalizeNoEndSeparator</a></span>(<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>
  393. <div class="block">Normalizes a path, removing double and single dot path steps,
  394. and removing any final directory separator.</div>
  395. </td>
  396. </tr>
  397. <tr id="i24" class="altColor">
  398. <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>
  399. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#normalizeNoEndSeparator-java.lang.String-boolean-">normalizeNoEndSeparator</a></span>(<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,
  400. boolean&nbsp;unixSeparator)</code>
  401. <div class="block">Normalizes a path, removing double and single dot path steps,
  402. and removing any final directory separator.</div>
  403. </td>
  404. </tr>
  405. <tr id="i25" class="rowColor">
  406. <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>
  407. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#removeExtension-java.lang.String-">removeExtension</a></span>(<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>
  408. <div class="block">Removes the extension from a filename.</div>
  409. </td>
  410. </tr>
  411. <tr id="i26" class="altColor">
  412. <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>
  413. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#separatorsToSystem-java.lang.String-">separatorsToSystem</a></span>(<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;path)</code>
  414. <div class="block">Converts all separators to the system separator.</div>
  415. </td>
  416. </tr>
  417. <tr id="i27" class="rowColor">
  418. <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>
  419. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#separatorsToUnix-java.lang.String-">separatorsToUnix</a></span>(<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;path)</code>
  420. <div class="block">Converts all separators to the Unix separator of forward slash.</div>
  421. </td>
  422. </tr>
  423. <tr id="i28" class="altColor">
  424. <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>
  425. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#separatorsToWindows-java.lang.String-">separatorsToWindows</a></span>(<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;path)</code>
  426. <div class="block">Converts all separators to the Windows separator of backslash.</div>
  427. </td>
  428. </tr>
  429. <tr id="i29" class="rowColor">
  430. <td class="colFirst"><code>static boolean</code></td>
  431. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#wildcardMatch-java.lang.String-java.lang.String-">wildcardMatch</a></span>(<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,
  432. <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;wildcardMatcher)</code>
  433. <div class="block">Checks a filename to see if it matches the specified wildcard matcher,
  434. always testing case-sensitive.</div>
  435. </td>
  436. </tr>
  437. <tr id="i30" class="altColor">
  438. <td class="colFirst"><code>static boolean</code></td>
  439. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#wildcardMatch-java.lang.String-java.lang.String-org.apache.commons.io.IOCase-">wildcardMatch</a></span>(<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,
  440. <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;wildcardMatcher,
  441. <a href="../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</code>
  442. <div class="block">Checks a filename to see if it matches the specified wildcard matcher
  443. allowing control over case-sensitivity.</div>
  444. </td>
  445. </tr>
  446. <tr id="i31" class="rowColor">
  447. <td class="colFirst"><code>static boolean</code></td>
  448. <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FilenameUtils.html#wildcardMatchOnSystem-java.lang.String-java.lang.String-">wildcardMatchOnSystem</a></span>(<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,
  449. <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;wildcardMatcher)</code>
  450. <div class="block">Checks a filename to see if it matches the specified wildcard matcher
  451. using the case rules of the system.</div>
  452. </td>
  453. </tr>
  454. </table>
  455. <ul class="blockList">
  456. <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
  457. <!-- -->
  458. </a>
  459. <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>
  460. <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-int-" title="class or interface in java.lang">wait</a></code></li>
  461. </ul>
  462. </li>
  463. </ul>
  464. </li>
  465. </ul>
  466. </div>
  467. <div class="details">
  468. <ul class="blockList">
  469. <li class="blockList">
  470. <!-- ============ FIELD DETAIL =========== -->
  471. <ul class="blockList">
  472. <li class="blockList"><a name="field.detail">
  473. <!-- -->
  474. </a>
  475. <h3>Field Detail</h3>
  476. <a name="EXTENSION_SEPARATOR">
  477. <!-- -->
  478. </a>
  479. <ul class="blockList">
  480. <li class="blockList">
  481. <h4>EXTENSION_SEPARATOR</h4>
  482. <pre>public static final&nbsp;char EXTENSION_SEPARATOR</pre>
  483. <div class="block">The extension separator character.</div>
  484. <dl>
  485. <dt><span class="simpleTagLabel">Since:</span></dt>
  486. <dd>1.4</dd>
  487. <dt><span class="seeLabel">See Also:</span></dt>
  488. <dd><a href="../../../../constant-values.html#org.apache.commons.io.FilenameUtils.EXTENSION_SEPARATOR">Constant Field Values</a></dd>
  489. </dl>
  490. </li>
  491. </ul>
  492. <a name="EXTENSION_SEPARATOR_STR">
  493. <!-- -->
  494. </a>
  495. <ul class="blockListLast">
  496. <li class="blockList">
  497. <h4>EXTENSION_SEPARATOR_STR</h4>
  498. <pre>public static final&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> EXTENSION_SEPARATOR_STR</pre>
  499. <div class="block">The extension separator String.</div>
  500. <dl>
  501. <dt><span class="simpleTagLabel">Since:</span></dt>
  502. <dd>1.4</dd>
  503. </dl>
  504. </li>
  505. </ul>
  506. </li>
  507. </ul>
  508. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  509. <ul class="blockList">
  510. <li class="blockList"><a name="constructor.detail">
  511. <!-- -->
  512. </a>
  513. <h3>Constructor Detail</h3>
  514. <a name="FilenameUtils--">
  515. <!-- -->
  516. </a>
  517. <ul class="blockListLast">
  518. <li class="blockList">
  519. <h4>FilenameUtils</h4>
  520. <pre>public&nbsp;FilenameUtils()</pre>
  521. <div class="block">Instances should NOT be constructed in standard programming.</div>
  522. </li>
  523. </ul>
  524. </li>
  525. </ul>
  526. <!-- ============ METHOD DETAIL ========== -->
  527. <ul class="blockList">
  528. <li class="blockList"><a name="method.detail">
  529. <!-- -->
  530. </a>
  531. <h3>Method Detail</h3>
  532. <a name="normalize-java.lang.String-">
  533. <!-- -->
  534. </a>
  535. <ul class="blockList">
  536. <li class="blockList">
  537. <h4>normalize</h4>
  538. <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;normalize(<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>
  539. <div class="block">Normalizes a path, removing double and single dot path steps.
  540. <p>
  541. This method normalizes a path to a standard format.
  542. The input may contain separators in either Unix or Windows format.
  543. The output will contain separators in the format of the system.
  544. <p>
  545. A trailing slash will be retained.
  546. A double slash will be merged to a single slash (but UNC names are handled).
  547. A single dot path segment will be removed.
  548. A double dot will cause that path segment and the one before to be removed.
  549. If the double dot has no parent path segment to work with, <code>null</code>
  550. is returned.
  551. <p>
  552. The output will be the same on both Unix and Windows except
  553. for the separator character.
  554. <pre>
  555. /foo// --&gt; /foo/
  556. /foo/./ --&gt; /foo/
  557. /foo/../bar --&gt; /bar
  558. /foo/../bar/ --&gt; /bar/
  559. /foo/../bar/../baz --&gt; /baz
  560. //foo//./bar --&gt; /foo/bar
  561. /../ --&gt; null
  562. ../foo --&gt; null
  563. foo/bar/.. --&gt; foo/
  564. foo/../../bar --&gt; null
  565. foo/../bar --&gt; bar
  566. //server/foo/../bar --&gt; //server/bar
  567. //server/../bar --&gt; null
  568. C:\foo\..\bar --&gt; C:\bar
  569. C:\..\bar --&gt; null
  570. ~/foo/../bar/ --&gt; ~/bar/
  571. ~/../bar --&gt; null
  572. </pre>
  573. (Note the file separator returned will be correct for Windows/Unix)</div>
  574. <dl>
  575. <dt><span class="paramLabel">Parameters:</span></dt>
  576. <dd><code>filename</code> - the filename to normalize, null returns null</dd>
  577. <dt><span class="returnLabel">Returns:</span></dt>
  578. <dd>the normalized filename, or null if invalid. Null bytes inside string will be removed</dd>
  579. </dl>
  580. </li>
  581. </ul>
  582. <a name="normalize-java.lang.String-boolean-">
  583. <!-- -->
  584. </a>
  585. <ul class="blockList">
  586. <li class="blockList">
  587. <h4>normalize</h4>
  588. <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;normalize(<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,
  589. boolean&nbsp;unixSeparator)</pre>
  590. <div class="block">Normalizes a path, removing double and single dot path steps.
  591. <p>
  592. This method normalizes a path to a standard format.
  593. The input may contain separators in either Unix or Windows format.
  594. The output will contain separators in the format specified.
  595. <p>
  596. A trailing slash will be retained.
  597. A double slash will be merged to a single slash (but UNC names are handled).
  598. A single dot path segment will be removed.
  599. A double dot will cause that path segment and the one before to be removed.
  600. If the double dot has no parent path segment to work with, <code>null</code>
  601. is returned.
  602. <p>
  603. The output will be the same on both Unix and Windows except
  604. for the separator character.
  605. <pre>
  606. /foo// --&gt; /foo/
  607. /foo/./ --&gt; /foo/
  608. /foo/../bar --&gt; /bar
  609. /foo/../bar/ --&gt; /bar/
  610. /foo/../bar/../baz --&gt; /baz
  611. //foo//./bar --&gt; /foo/bar
  612. /../ --&gt; null
  613. ../foo --&gt; null
  614. foo/bar/.. --&gt; foo/
  615. foo/../../bar --&gt; null
  616. foo/../bar --&gt; bar
  617. //server/foo/../bar --&gt; //server/bar
  618. //server/../bar --&gt; null
  619. C:\foo\..\bar --&gt; C:\bar
  620. C:\..\bar --&gt; null
  621. ~/foo/../bar/ --&gt; ~/bar/
  622. ~/../bar --&gt; null
  623. </pre>
  624. The output will be the same on both Unix and Windows including
  625. the separator character.</div>
  626. <dl>
  627. <dt><span class="paramLabel">Parameters:</span></dt>
  628. <dd><code>filename</code> - the filename to normalize, null returns null</dd>
  629. <dd><code>unixSeparator</code> - <code>true</code> if a unix separator should
  630. be used or <code>false</code> if a windows separator should be used.</dd>
  631. <dt><span class="returnLabel">Returns:</span></dt>
  632. <dd>the normalized filename, or null if invalid. Null bytes inside string will be removed</dd>
  633. <dt><span class="simpleTagLabel">Since:</span></dt>
  634. <dd>2.0</dd>
  635. </dl>
  636. </li>
  637. </ul>
  638. <a name="normalizeNoEndSeparator-java.lang.String-">
  639. <!-- -->
  640. </a>
  641. <ul class="blockList">
  642. <li class="blockList">
  643. <h4>normalizeNoEndSeparator</h4>
  644. <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;normalizeNoEndSeparator(<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>
  645. <div class="block">Normalizes a path, removing double and single dot path steps,
  646. and removing any final directory separator.
  647. <p>
  648. This method normalizes a path to a standard format.
  649. The input may contain separators in either Unix or Windows format.
  650. The output will contain separators in the format of the system.
  651. <p>
  652. A trailing slash will be removed.
  653. A double slash will be merged to a single slash (but UNC names are handled).
  654. A single dot path segment will be removed.
  655. A double dot will cause that path segment and the one before to be removed.
  656. If the double dot has no parent path segment to work with, <code>null</code>
  657. is returned.
  658. <p>
  659. The output will be the same on both Unix and Windows except
  660. for the separator character.
  661. <pre>
  662. /foo// --&gt; /foo
  663. /foo/./ --&gt; /foo
  664. /foo/../bar --&gt; /bar
  665. /foo/../bar/ --&gt; /bar
  666. /foo/../bar/../baz --&gt; /baz
  667. //foo//./bar --&gt; /foo/bar
  668. /../ --&gt; null
  669. ../foo --&gt; null
  670. foo/bar/.. --&gt; foo
  671. foo/../../bar --&gt; null
  672. foo/../bar --&gt; bar
  673. //server/foo/../bar --&gt; //server/bar
  674. //server/../bar --&gt; null
  675. C:\foo\..\bar --&gt; C:\bar
  676. C:\..\bar --&gt; null
  677. ~/foo/../bar/ --&gt; ~/bar
  678. ~/../bar --&gt; null
  679. </pre>
  680. (Note the file separator returned will be correct for Windows/Unix)</div>
  681. <dl>
  682. <dt><span class="paramLabel">Parameters:</span></dt>
  683. <dd><code>filename</code> - the filename to normalize, null returns null</dd>
  684. <dt><span class="returnLabel">Returns:</span></dt>
  685. <dd>the normalized filename, or null if invalid. Null bytes inside string will be removed</dd>
  686. </dl>
  687. </li>
  688. </ul>
  689. <a name="normalizeNoEndSeparator-java.lang.String-boolean-">
  690. <!-- -->
  691. </a>
  692. <ul class="blockList">
  693. <li class="blockList">
  694. <h4>normalizeNoEndSeparator</h4>
  695. <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;normalizeNoEndSeparator(<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,
  696. boolean&nbsp;unixSeparator)</pre>
  697. <div class="block">Normalizes a path, removing double and single dot path steps,
  698. and removing any final directory separator.
  699. <p>
  700. This method normalizes a path to a standard format.
  701. The input may contain separators in either Unix or Windows format.
  702. The output will contain separators in the format specified.
  703. <p>
  704. A trailing slash will be removed.
  705. A double slash will be merged to a single slash (but UNC names are handled).
  706. A single dot path segment will be removed.
  707. A double dot will cause that path segment and the one before to be removed.
  708. If the double dot has no parent path segment to work with, <code>null</code>
  709. is returned.
  710. <p>
  711. The output will be the same on both Unix and Windows including
  712. the separator character.
  713. <pre>
  714. /foo// --&gt; /foo
  715. /foo/./ --&gt; /foo
  716. /foo/../bar --&gt; /bar
  717. /foo/../bar/ --&gt; /bar
  718. /foo/../bar/../baz --&gt; /baz
  719. //foo//./bar --&gt; /foo/bar
  720. /../ --&gt; null
  721. ../foo --&gt; null
  722. foo/bar/.. --&gt; foo
  723. foo/../../bar --&gt; null
  724. foo/../bar --&gt; bar
  725. //server/foo/../bar --&gt; //server/bar
  726. //server/../bar --&gt; null
  727. C:\foo\..\bar --&gt; C:\bar
  728. C:\..\bar --&gt; null
  729. ~/foo/../bar/ --&gt; ~/bar
  730. ~/../bar --&gt; null
  731. </pre></div>
  732. <dl>
  733. <dt><span class="paramLabel">Parameters:</span></dt>
  734. <dd><code>filename</code> - the filename to normalize, null returns null</dd>
  735. <dd><code>unixSeparator</code> - <code>true</code> if a unix separator should
  736. be used or <code>false</code> if a windows separator should be used.</dd>
  737. <dt><span class="returnLabel">Returns:</span></dt>
  738. <dd>the normalized filename, or null if invalid. Null bytes inside string will be removed</dd>
  739. <dt><span class="simpleTagLabel">Since:</span></dt>
  740. <dd>2.0</dd>
  741. </dl>
  742. </li>
  743. </ul>
  744. <a name="concat-java.lang.String-java.lang.String-">
  745. <!-- -->
  746. </a>
  747. <ul class="blockList">
  748. <li class="blockList">
  749. <h4>concat</h4>
  750. <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;concat(<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;basePath,
  751. <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;fullFilenameToAdd)</pre>
  752. <div class="block">Concatenates a filename to a base path using normal command line style rules.
  753. <p>
  754. The effect is equivalent to resultant directory after changing
  755. directory to the first argument, followed by changing directory to
  756. the second argument.
  757. <p>
  758. The first argument is the base path, the second is the path to concatenate.
  759. The returned path is always normalized via <a href="../../../../org/apache/commons/io/FilenameUtils.html#normalize-java.lang.String-"><code>normalize(String)</code></a>,
  760. thus <code>..</code> is handled.
  761. <p>
  762. If <code>pathToAdd</code> is absolute (has an absolute prefix), then
  763. it will be normalized and returned.
  764. Otherwise, the paths will be joined, normalized and returned.
  765. <p>
  766. The output will be the same on both Unix and Windows except
  767. for the separator character.
  768. <pre>
  769. /foo/ + bar --&gt; /foo/bar
  770. /foo + bar --&gt; /foo/bar
  771. /foo + /bar --&gt; /bar
  772. /foo + C:/bar --&gt; C:/bar
  773. /foo + C:bar --&gt; C:bar (*)
  774. /foo/a/ + ../bar --&gt; foo/bar
  775. /foo/ + ../../bar --&gt; null
  776. /foo/ + /bar --&gt; /bar
  777. /foo/.. + /bar --&gt; /bar
  778. /foo + bar/c.txt --&gt; /foo/bar/c.txt
  779. /foo/c.txt + bar --&gt; /foo/c.txt/bar (!)
  780. </pre>
  781. (*) Note that the Windows relative drive prefix is unreliable when
  782. used with this method.
  783. (!) Note that the first parameter must be a path. If it ends with a name, then
  784. the name will be built into the concatenated path. If this might be a problem,
  785. use <a href="../../../../org/apache/commons/io/FilenameUtils.html#getFullPath-java.lang.String-"><code>getFullPath(String)</code></a> on the base path argument.</div>
  786. <dl>
  787. <dt><span class="paramLabel">Parameters:</span></dt>
  788. <dd><code>basePath</code> - the base path to attach to, always treated as a path</dd>
  789. <dd><code>fullFilenameToAdd</code> - the filename (or path) to attach to the base</dd>
  790. <dt><span class="returnLabel">Returns:</span></dt>
  791. <dd>the concatenated path, or null if invalid. Null bytes inside string will be removed</dd>
  792. </dl>
  793. </li>
  794. </ul>
  795. <a name="directoryContains-java.lang.String-java.lang.String-">
  796. <!-- -->
  797. </a>
  798. <ul class="blockList">
  799. <li class="blockList">
  800. <h4>directoryContains</h4>
  801. <pre>public static&nbsp;boolean&nbsp;directoryContains(<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;canonicalParent,
  802. <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;canonicalChild)
  803. throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
  804. <div class="block">Determines whether the <code>parent</code> directory contains the <code>child</code> element (a file or directory).
  805. <p>
  806. The files names are expected to be normalized.
  807. </p>
  808. Edge cases:
  809. <ul>
  810. <li>A <code>directory</code> must not be null: if null, throw IllegalArgumentException</li>
  811. <li>A directory does not contain itself: return false</li>
  812. <li>A null child file is not contained in any parent: return false</li>
  813. </ul></div>
  814. <dl>
  815. <dt><span class="paramLabel">Parameters:</span></dt>
  816. <dd><code>canonicalParent</code> - the file to consider as the parent.</dd>
  817. <dd><code>canonicalChild</code> - the file to consider as the child.</dd>
  818. <dt><span class="returnLabel">Returns:</span></dt>
  819. <dd>true is the candidate leaf is under by the specified composite. False otherwise.</dd>
  820. <dt><span class="throwsLabel">Throws:</span></dt>
  821. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an IO error occurs while checking the files.</dd>
  822. <dt><span class="simpleTagLabel">Since:</span></dt>
  823. <dd>2.2</dd>
  824. <dt><span class="seeLabel">See Also:</span></dt>
  825. <dd><a href="../../../../org/apache/commons/io/FileUtils.html#directoryContains-java.io.File-java.io.File-"><code>FileUtils.directoryContains(File, File)</code></a></dd>
  826. </dl>
  827. </li>
  828. </ul>
  829. <a name="separatorsToUnix-java.lang.String-">
  830. <!-- -->
  831. </a>
  832. <ul class="blockList">
  833. <li class="blockList">
  834. <h4>separatorsToUnix</h4>
  835. <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;separatorsToUnix(<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;path)</pre>
  836. <div class="block">Converts all separators to the Unix separator of forward slash.</div>
  837. <dl>
  838. <dt><span class="paramLabel">Parameters:</span></dt>
  839. <dd><code>path</code> - the path to be changed, null ignored</dd>
  840. <dt><span class="returnLabel">Returns:</span></dt>
  841. <dd>the updated path</dd>
  842. </dl>
  843. </li>
  844. </ul>
  845. <a name="separatorsToWindows-java.lang.String-">
  846. <!-- -->
  847. </a>
  848. <ul class="blockList">
  849. <li class="blockList">
  850. <h4>separatorsToWindows</h4>
  851. <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;separatorsToWindows(<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;path)</pre>
  852. <div class="block">Converts all separators to the Windows separator of backslash.</div>
  853. <dl>
  854. <dt><span class="paramLabel">Parameters:</span></dt>
  855. <dd><code>path</code> - the path to be changed, null ignored</dd>
  856. <dt><span class="returnLabel">Returns:</span></dt>
  857. <dd>the updated path</dd>
  858. </dl>
  859. </li>
  860. </ul>
  861. <a name="separatorsToSystem-java.lang.String-">
  862. <!-- -->
  863. </a>
  864. <ul class="blockList">
  865. <li class="blockList">
  866. <h4>separatorsToSystem</h4>
  867. <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;separatorsToSystem(<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;path)</pre>
  868. <div class="block">Converts all separators to the system separator.</div>
  869. <dl>
  870. <dt><span class="paramLabel">Parameters:</span></dt>
  871. <dd><code>path</code> - the path to be changed, null ignored</dd>
  872. <dt><span class="returnLabel">Returns:</span></dt>
  873. <dd>the updated path</dd>
  874. </dl>
  875. </li>
  876. </ul>
  877. <a name="getPrefixLength-java.lang.String-">
  878. <!-- -->
  879. </a>
  880. <ul class="blockList">
  881. <li class="blockList">
  882. <h4>getPrefixLength</h4>
  883. <pre>public static&nbsp;int&nbsp;getPrefixLength(<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>
  884. <div class="block">Returns the length of the filename prefix, such as <code>C:/</code> or <code>~/</code>.
  885. <p>
  886. This method will handle a file in either Unix or Windows format.
  887. <p>
  888. The prefix length includes the first slash in the full filename
  889. if applicable. Thus, it is possible that the length returned is greater
  890. than the length of the input string.
  891. <pre>
  892. Windows:
  893. a\b\c.txt --&gt; "" --&gt; relative
  894. \a\b\c.txt --&gt; "\" --&gt; current drive absolute
  895. C:a\b\c.txt --&gt; "C:" --&gt; drive relative
  896. C:\a\b\c.txt --&gt; "C:\" --&gt; absolute
  897. \\server\a\b\c.txt --&gt; "\\server\" --&gt; UNC
  898. \\\a\b\c.txt --&gt; error, length = -1
  899. Unix:
  900. a/b/c.txt --&gt; "" --&gt; relative
  901. /a/b/c.txt --&gt; "/" --&gt; absolute
  902. ~/a/b/c.txt --&gt; "~/" --&gt; current user
  903. ~ --&gt; "~/" --&gt; current user (slash added)
  904. ~user/a/b/c.txt --&gt; "~user/" --&gt; named user
  905. ~user --&gt; "~user/" --&gt; named user (slash added)
  906. //server/a/b/c.txt --&gt; "//server/"
  907. ///a/b/c.txt --&gt; error, length = -1
  908. </pre>
  909. <p>
  910. The output will be the same irrespective of the machine that the code is running on.
  911. ie. both Unix and Windows prefixes are matched regardless.
  912. Note that a leading // (or \\) is used to indicate a UNC name on Windows.
  913. These must be followed by a server name, so double-slashes are not collapsed
  914. to a single slash at the start of the filename.</div>
  915. <dl>
  916. <dt><span class="paramLabel">Parameters:</span></dt>
  917. <dd><code>filename</code> - the filename to find the prefix in, null returns -1</dd>
  918. <dt><span class="returnLabel">Returns:</span></dt>
  919. <dd>the length of the prefix, -1 if invalid or null</dd>
  920. </dl>
  921. </li>
  922. </ul>
  923. <a name="indexOfLastSeparator-java.lang.String-">
  924. <!-- -->
  925. </a>
  926. <ul class="blockList">
  927. <li class="blockList">
  928. <h4>indexOfLastSeparator</h4>
  929. <pre>public static&nbsp;int&nbsp;indexOfLastSeparator(<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>
  930. <div class="block">Returns the index of the last directory separator character.
  931. <p>
  932. This method will handle a file in either Unix or Windows format.
  933. The position of the last forward or backslash is returned.
  934. <p>
  935. The output will be the same irrespective of the machine that the code is running on.</div>
  936. <dl>
  937. <dt><span class="paramLabel">Parameters:</span></dt>
  938. <dd><code>filename</code> - the filename to find the last path separator in, null returns -1</dd>
  939. <dt><span class="returnLabel">Returns:</span></dt>
  940. <dd>the index of the last separator character, or -1 if there
  941. is no such character</dd>
  942. </dl>
  943. </li>
  944. </ul>
  945. <a name="indexOfExtension-java.lang.String-">
  946. <!-- -->
  947. </a>
  948. <ul class="blockList">
  949. <li class="blockList">
  950. <h4>indexOfExtension</h4>
  951. <pre>public static&nbsp;int&nbsp;indexOfExtension(<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>
  952. <div class="block">Returns the index of the last extension separator character, which is a dot.
  953. <p>
  954. This method also checks that there is no directory separator after the last dot. To do this it uses
  955. <a href="../../../../org/apache/commons/io/FilenameUtils.html#indexOfLastSeparator-java.lang.String-"><code>indexOfLastSeparator(String)</code></a> which will handle a file in either Unix or Windows format.
  956. </p>
  957. <p>
  958. The output will be the same irrespective of the machine that the code is running on.
  959. </p></div>
  960. <dl>
  961. <dt><span class="paramLabel">Parameters:</span></dt>
  962. <dd><code>filename</code> - the filename to find the last extension separator in, null returns -1</dd>
  963. <dt><span class="returnLabel">Returns:</span></dt>
  964. <dd>the index of the last extension separator character, or -1 if there is no such character</dd>
  965. </dl>
  966. </li>
  967. </ul>
  968. <a name="getPrefix-java.lang.String-">
  969. <!-- -->
  970. </a>
  971. <ul class="blockList">
  972. <li class="blockList">
  973. <h4>getPrefix</h4>
  974. <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;getPrefix(<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>
  975. <div class="block">Gets the prefix from a full filename, such as <code>C:/</code>
  976. or <code>~/</code>.
  977. <p>
  978. This method will handle a file in either Unix or Windows format.
  979. The prefix includes the first slash in the full filename where applicable.
  980. <pre>
  981. Windows:
  982. a\b\c.txt --&gt; "" --&gt; relative
  983. \a\b\c.txt --&gt; "\" --&gt; current drive absolute
  984. C:a\b\c.txt --&gt; "C:" --&gt; drive relative
  985. C:\a\b\c.txt --&gt; "C:\" --&gt; absolute
  986. \\server\a\b\c.txt --&gt; "\\server\" --&gt; UNC
  987. Unix:
  988. a/b/c.txt --&gt; "" --&gt; relative
  989. /a/b/c.txt --&gt; "/" --&gt; absolute
  990. ~/a/b/c.txt --&gt; "~/" --&gt; current user
  991. ~ --&gt; "~/" --&gt; current user (slash added)
  992. ~user/a/b/c.txt --&gt; "~user/" --&gt; named user
  993. ~user --&gt; "~user/" --&gt; named user (slash added)
  994. </pre>
  995. <p>
  996. The output will be the same irrespective of the machine that the code is running on.
  997. ie. both Unix and Windows prefixes are matched regardless.</div>
  998. <dl>
  999. <dt><span class="paramLabel">Parameters:</span></dt>
  1000. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1001. <dt><span class="returnLabel">Returns:</span></dt>
  1002. <dd>the prefix of the file, null if invalid. Null bytes inside string will be removed</dd>
  1003. </dl>
  1004. </li>
  1005. </ul>
  1006. <a name="getPath-java.lang.String-">
  1007. <!-- -->
  1008. </a>
  1009. <ul class="blockList">
  1010. <li class="blockList">
  1011. <h4>getPath</h4>
  1012. <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;getPath(<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>
  1013. <div class="block">Gets the path from a full filename, which excludes the prefix.
  1014. <p>
  1015. This method will handle a file in either Unix or Windows format.
  1016. The method is entirely text based, and returns the text before and
  1017. including the last forward or backslash.
  1018. <pre>
  1019. C:\a\b\c.txt --&gt; a\b\
  1020. ~/a/b/c.txt --&gt; a/b/
  1021. a.txt --&gt; ""
  1022. a/b/c --&gt; a/b/
  1023. a/b/c/ --&gt; a/b/c/
  1024. </pre>
  1025. <p>
  1026. The output will be the same irrespective of the machine that the code is running on.
  1027. <p>
  1028. This method drops the prefix from the result.
  1029. See <a href="../../../../org/apache/commons/io/FilenameUtils.html#getFullPath-java.lang.String-"><code>getFullPath(String)</code></a> for the method that retains the prefix.</div>
  1030. <dl>
  1031. <dt><span class="paramLabel">Parameters:</span></dt>
  1032. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1033. <dt><span class="returnLabel">Returns:</span></dt>
  1034. <dd>the path of the file, an empty string if none exists, null if invalid.
  1035. Null bytes inside string will be removed</dd>
  1036. </dl>
  1037. </li>
  1038. </ul>
  1039. <a name="getPathNoEndSeparator-java.lang.String-">
  1040. <!-- -->
  1041. </a>
  1042. <ul class="blockList">
  1043. <li class="blockList">
  1044. <h4>getPathNoEndSeparator</h4>
  1045. <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;getPathNoEndSeparator(<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>
  1046. <div class="block">Gets the path from a full filename, which excludes the prefix, and
  1047. also excluding the final directory separator.
  1048. <p>
  1049. This method will handle a file in either Unix or Windows format.
  1050. The method is entirely text based, and returns the text before the
  1051. last forward or backslash.
  1052. <pre>
  1053. C:\a\b\c.txt --&gt; a\b
  1054. ~/a/b/c.txt --&gt; a/b
  1055. a.txt --&gt; ""
  1056. a/b/c --&gt; a/b
  1057. a/b/c/ --&gt; a/b/c
  1058. </pre>
  1059. <p>
  1060. The output will be the same irrespective of the machine that the code is running on.
  1061. <p>
  1062. This method drops the prefix from the result.
  1063. See <a href="../../../../org/apache/commons/io/FilenameUtils.html#getFullPathNoEndSeparator-java.lang.String-"><code>getFullPathNoEndSeparator(String)</code></a> for the method that retains the prefix.</div>
  1064. <dl>
  1065. <dt><span class="paramLabel">Parameters:</span></dt>
  1066. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1067. <dt><span class="returnLabel">Returns:</span></dt>
  1068. <dd>the path of the file, an empty string if none exists, null if invalid.
  1069. Null bytes inside string will be removed</dd>
  1070. </dl>
  1071. </li>
  1072. </ul>
  1073. <a name="getFullPath-java.lang.String-">
  1074. <!-- -->
  1075. </a>
  1076. <ul class="blockList">
  1077. <li class="blockList">
  1078. <h4>getFullPath</h4>
  1079. <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;getFullPath(<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>
  1080. <div class="block">Gets the full path from a full filename, which is the prefix + path.
  1081. <p>
  1082. This method will handle a file in either Unix or Windows format.
  1083. The method is entirely text based, and returns the text before and
  1084. including the last forward or backslash.
  1085. <pre>
  1086. C:\a\b\c.txt --&gt; C:\a\b\
  1087. ~/a/b/c.txt --&gt; ~/a/b/
  1088. a.txt --&gt; ""
  1089. a/b/c --&gt; a/b/
  1090. a/b/c/ --&gt; a/b/c/
  1091. C: --&gt; C:
  1092. C:\ --&gt; C:\
  1093. ~ --&gt; ~/
  1094. ~/ --&gt; ~/
  1095. ~user --&gt; ~user/
  1096. ~user/ --&gt; ~user/
  1097. </pre>
  1098. <p>
  1099. The output will be the same irrespective of the machine that the code is running on.</div>
  1100. <dl>
  1101. <dt><span class="paramLabel">Parameters:</span></dt>
  1102. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1103. <dt><span class="returnLabel">Returns:</span></dt>
  1104. <dd>the path of the file, an empty string if none exists, null if invalid</dd>
  1105. </dl>
  1106. </li>
  1107. </ul>
  1108. <a name="getFullPathNoEndSeparator-java.lang.String-">
  1109. <!-- -->
  1110. </a>
  1111. <ul class="blockList">
  1112. <li class="blockList">
  1113. <h4>getFullPathNoEndSeparator</h4>
  1114. <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;getFullPathNoEndSeparator(<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>
  1115. <div class="block">Gets the full path from a full filename, which is the prefix + path,
  1116. and also excluding the final directory separator.
  1117. <p>
  1118. This method will handle a file in either Unix or Windows format.
  1119. The method is entirely text based, and returns the text before the
  1120. last forward or backslash.
  1121. <pre>
  1122. C:\a\b\c.txt --&gt; C:\a\b
  1123. ~/a/b/c.txt --&gt; ~/a/b
  1124. a.txt --&gt; ""
  1125. a/b/c --&gt; a/b
  1126. a/b/c/ --&gt; a/b/c
  1127. C: --&gt; C:
  1128. C:\ --&gt; C:\
  1129. ~ --&gt; ~
  1130. ~/ --&gt; ~
  1131. ~user --&gt; ~user
  1132. ~user/ --&gt; ~user
  1133. </pre>
  1134. <p>
  1135. The output will be the same irrespective of the machine that the code is running on.</div>
  1136. <dl>
  1137. <dt><span class="paramLabel">Parameters:</span></dt>
  1138. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1139. <dt><span class="returnLabel">Returns:</span></dt>
  1140. <dd>the path of the file, an empty string if none exists, null if invalid</dd>
  1141. </dl>
  1142. </li>
  1143. </ul>
  1144. <a name="getName-java.lang.String-">
  1145. <!-- -->
  1146. </a>
  1147. <ul class="blockList">
  1148. <li class="blockList">
  1149. <h4>getName</h4>
  1150. <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;getName(<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>
  1151. <div class="block">Gets the name minus the path from a full filename.
  1152. <p>
  1153. This method will handle a file in either Unix or Windows format.
  1154. The text after the last forward or backslash is returned.
  1155. <pre>
  1156. a/b/c.txt --&gt; c.txt
  1157. a.txt --&gt; a.txt
  1158. a/b/c --&gt; c
  1159. a/b/c/ --&gt; ""
  1160. </pre>
  1161. <p>
  1162. The output will be the same irrespective of the machine that the code is running on.</div>
  1163. <dl>
  1164. <dt><span class="paramLabel">Parameters:</span></dt>
  1165. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1166. <dt><span class="returnLabel">Returns:</span></dt>
  1167. <dd>the name of the file without the path, or an empty string if none exists.
  1168. Null bytes inside string will be removed</dd>
  1169. </dl>
  1170. </li>
  1171. </ul>
  1172. <a name="getBaseName-java.lang.String-">
  1173. <!-- -->
  1174. </a>
  1175. <ul class="blockList">
  1176. <li class="blockList">
  1177. <h4>getBaseName</h4>
  1178. <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;getBaseName(<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>
  1179. <div class="block">Gets the base name, minus the full path and extension, from a full filename.
  1180. <p>
  1181. This method will handle a file in either Unix or Windows format.
  1182. The text after the last forward or backslash and before the last dot is returned.
  1183. <pre>
  1184. a/b/c.txt --&gt; c
  1185. a.txt --&gt; a
  1186. a/b/c --&gt; c
  1187. a/b/c/ --&gt; ""
  1188. </pre>
  1189. <p>
  1190. The output will be the same irrespective of the machine that the code is running on.</div>
  1191. <dl>
  1192. <dt><span class="paramLabel">Parameters:</span></dt>
  1193. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1194. <dt><span class="returnLabel">Returns:</span></dt>
  1195. <dd>the name of the file without the path, or an empty string if none exists. Null bytes inside string
  1196. will be removed</dd>
  1197. </dl>
  1198. </li>
  1199. </ul>
  1200. <a name="getExtension-java.lang.String-">
  1201. <!-- -->
  1202. </a>
  1203. <ul class="blockList">
  1204. <li class="blockList">
  1205. <h4>getExtension</h4>
  1206. <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;getExtension(<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>
  1207. <div class="block">Gets the extension of a filename.
  1208. <p>
  1209. This method returns the textual part of the filename after the last dot.
  1210. There must be no directory separator after the dot.
  1211. <pre>
  1212. foo.txt --&gt; "txt"
  1213. a/b/c.jpg --&gt; "jpg"
  1214. a/b.txt/c --&gt; ""
  1215. a/b/c --&gt; ""
  1216. </pre>
  1217. <p>
  1218. The output will be the same irrespective of the machine that the code is running on.</div>
  1219. <dl>
  1220. <dt><span class="paramLabel">Parameters:</span></dt>
  1221. <dd><code>filename</code> - the filename to retrieve the extension of.</dd>
  1222. <dt><span class="returnLabel">Returns:</span></dt>
  1223. <dd>the extension of the file or an empty string if none exists or <code>null</code>
  1224. if the filename is <code>null</code>.</dd>
  1225. </dl>
  1226. </li>
  1227. </ul>
  1228. <a name="removeExtension-java.lang.String-">
  1229. <!-- -->
  1230. </a>
  1231. <ul class="blockList">
  1232. <li class="blockList">
  1233. <h4>removeExtension</h4>
  1234. <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;removeExtension(<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>
  1235. <div class="block">Removes the extension from a filename.
  1236. <p>
  1237. This method returns the textual part of the filename before the last dot.
  1238. There must be no directory separator after the dot.
  1239. <pre>
  1240. foo.txt --&gt; foo
  1241. a\b\c.jpg --&gt; a\b\c
  1242. a\b\c --&gt; a\b\c
  1243. a.b\c --&gt; a.b\c
  1244. </pre>
  1245. <p>
  1246. The output will be the same irrespective of the machine that the code is running on.</div>
  1247. <dl>
  1248. <dt><span class="paramLabel">Parameters:</span></dt>
  1249. <dd><code>filename</code> - the filename to query, null returns null</dd>
  1250. <dt><span class="returnLabel">Returns:</span></dt>
  1251. <dd>the filename minus the extension</dd>
  1252. </dl>
  1253. </li>
  1254. </ul>
  1255. <a name="equals-java.lang.String-java.lang.String-">
  1256. <!-- -->
  1257. </a>
  1258. <ul class="blockList">
  1259. <li class="blockList">
  1260. <h4>equals</h4>
  1261. <pre>public static&nbsp;boolean&nbsp;equals(<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;filename1,
  1262. <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;filename2)</pre>
  1263. <div class="block">Checks whether two filenames are equal exactly.
  1264. <p>
  1265. No processing is performed on the filenames other than comparison,
  1266. thus this is merely a null-safe case-sensitive equals.</div>
  1267. <dl>
  1268. <dt><span class="paramLabel">Parameters:</span></dt>
  1269. <dd><code>filename1</code> - the first filename to query, may be null</dd>
  1270. <dd><code>filename2</code> - the second filename to query, may be null</dd>
  1271. <dt><span class="returnLabel">Returns:</span></dt>
  1272. <dd>true if the filenames are equal, null equals null</dd>
  1273. <dt><span class="seeLabel">See Also:</span></dt>
  1274. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SENSITIVE"><code>IOCase.SENSITIVE</code></a></dd>
  1275. </dl>
  1276. </li>
  1277. </ul>
  1278. <a name="equalsOnSystem-java.lang.String-java.lang.String-">
  1279. <!-- -->
  1280. </a>
  1281. <ul class="blockList">
  1282. <li class="blockList">
  1283. <h4>equalsOnSystem</h4>
  1284. <pre>public static&nbsp;boolean&nbsp;equalsOnSystem(<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;filename1,
  1285. <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;filename2)</pre>
  1286. <div class="block">Checks whether two filenames are equal using the case rules of the system.
  1287. <p>
  1288. No processing is performed on the filenames other than comparison.
  1289. The check is case-sensitive on Unix and case-insensitive on Windows.</div>
  1290. <dl>
  1291. <dt><span class="paramLabel">Parameters:</span></dt>
  1292. <dd><code>filename1</code> - the first filename to query, may be null</dd>
  1293. <dd><code>filename2</code> - the second filename to query, may be null</dd>
  1294. <dt><span class="returnLabel">Returns:</span></dt>
  1295. <dd>true if the filenames are equal, null equals null</dd>
  1296. <dt><span class="seeLabel">See Also:</span></dt>
  1297. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SYSTEM"><code>IOCase.SYSTEM</code></a></dd>
  1298. </dl>
  1299. </li>
  1300. </ul>
  1301. <a name="equalsNormalized-java.lang.String-java.lang.String-">
  1302. <!-- -->
  1303. </a>
  1304. <ul class="blockList">
  1305. <li class="blockList">
  1306. <h4>equalsNormalized</h4>
  1307. <pre>public static&nbsp;boolean&nbsp;equalsNormalized(<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;filename1,
  1308. <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;filename2)</pre>
  1309. <div class="block">Checks whether two filenames are equal after both have been normalized.
  1310. <p>
  1311. Both filenames are first passed to <a href="../../../../org/apache/commons/io/FilenameUtils.html#normalize-java.lang.String-"><code>normalize(String)</code></a>.
  1312. The check is then performed in a case-sensitive manner.</div>
  1313. <dl>
  1314. <dt><span class="paramLabel">Parameters:</span></dt>
  1315. <dd><code>filename1</code> - the first filename to query, may be null</dd>
  1316. <dd><code>filename2</code> - the second filename to query, may be null</dd>
  1317. <dt><span class="returnLabel">Returns:</span></dt>
  1318. <dd>true if the filenames are equal, null equals null</dd>
  1319. <dt><span class="seeLabel">See Also:</span></dt>
  1320. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SENSITIVE"><code>IOCase.SENSITIVE</code></a></dd>
  1321. </dl>
  1322. </li>
  1323. </ul>
  1324. <a name="equalsNormalizedOnSystem-java.lang.String-java.lang.String-">
  1325. <!-- -->
  1326. </a>
  1327. <ul class="blockList">
  1328. <li class="blockList">
  1329. <h4>equalsNormalizedOnSystem</h4>
  1330. <pre>public static&nbsp;boolean&nbsp;equalsNormalizedOnSystem(<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;filename1,
  1331. <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;filename2)</pre>
  1332. <div class="block">Checks whether two filenames are equal after both have been normalized
  1333. and using the case rules of the system.
  1334. <p>
  1335. Both filenames are first passed to <a href="../../../../org/apache/commons/io/FilenameUtils.html#normalize-java.lang.String-"><code>normalize(String)</code></a>.
  1336. The check is then performed case-sensitive on Unix and
  1337. case-insensitive on Windows.</div>
  1338. <dl>
  1339. <dt><span class="paramLabel">Parameters:</span></dt>
  1340. <dd><code>filename1</code> - the first filename to query, may be null</dd>
  1341. <dd><code>filename2</code> - the second filename to query, may be null</dd>
  1342. <dt><span class="returnLabel">Returns:</span></dt>
  1343. <dd>true if the filenames are equal, null equals null</dd>
  1344. <dt><span class="seeLabel">See Also:</span></dt>
  1345. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SYSTEM"><code>IOCase.SYSTEM</code></a></dd>
  1346. </dl>
  1347. </li>
  1348. </ul>
  1349. <a name="equals-java.lang.String-java.lang.String-boolean-org.apache.commons.io.IOCase-">
  1350. <!-- -->
  1351. </a>
  1352. <ul class="blockList">
  1353. <li class="blockList">
  1354. <h4>equals</h4>
  1355. <pre>public static&nbsp;boolean&nbsp;equals(<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;filename1,
  1356. <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;filename2,
  1357. boolean&nbsp;normalized,
  1358. <a href="../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
  1359. <div class="block">Checks whether two filenames are equal, optionally normalizing and providing
  1360. control over the case-sensitivity.</div>
  1361. <dl>
  1362. <dt><span class="paramLabel">Parameters:</span></dt>
  1363. <dd><code>filename1</code> - the first filename to query, may be null</dd>
  1364. <dd><code>filename2</code> - the second filename to query, may be null</dd>
  1365. <dd><code>normalized</code> - whether to normalize the filenames</dd>
  1366. <dd><code>caseSensitivity</code> - what case sensitivity rule to use, null means case-sensitive</dd>
  1367. <dt><span class="returnLabel">Returns:</span></dt>
  1368. <dd>true if the filenames are equal, null equals null</dd>
  1369. <dt><span class="simpleTagLabel">Since:</span></dt>
  1370. <dd>1.3</dd>
  1371. </dl>
  1372. </li>
  1373. </ul>
  1374. <a name="isExtension-java.lang.String-java.lang.String-">
  1375. <!-- -->
  1376. </a>
  1377. <ul class="blockList">
  1378. <li class="blockList">
  1379. <h4>isExtension</h4>
  1380. <pre>public static&nbsp;boolean&nbsp;isExtension(<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,
  1381. <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;extension)</pre>
  1382. <div class="block">Checks whether the extension of the filename is that specified.
  1383. <p>
  1384. This method obtains the extension as the textual part of the filename
  1385. after the last dot. There must be no directory separator after the dot.
  1386. The extension check is case-sensitive on all platforms.</div>
  1387. <dl>
  1388. <dt><span class="paramLabel">Parameters:</span></dt>
  1389. <dd><code>filename</code> - the filename to query, null returns false</dd>
  1390. <dd><code>extension</code> - the extension to check for, null or empty checks for no extension</dd>
  1391. <dt><span class="returnLabel">Returns:</span></dt>
  1392. <dd>true if the filename has the specified extension</dd>
  1393. <dt><span class="throwsLabel">Throws:</span></dt>
  1394. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the supplied filename contains null bytes</dd>
  1395. </dl>
  1396. </li>
  1397. </ul>
  1398. <a name="isExtension-java.lang.String-java.lang.String:A-">
  1399. <!-- -->
  1400. </a>
  1401. <ul class="blockList">
  1402. <li class="blockList">
  1403. <h4>isExtension</h4>
  1404. <pre>public static&nbsp;boolean&nbsp;isExtension(<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,
  1405. <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;extensions)</pre>
  1406. <div class="block">Checks whether the extension of the filename is one of those specified.
  1407. <p>
  1408. This method obtains the extension as the textual part of the filename
  1409. after the last dot. There must be no directory separator after the dot.
  1410. The extension check is case-sensitive on all platforms.</div>
  1411. <dl>
  1412. <dt><span class="paramLabel">Parameters:</span></dt>
  1413. <dd><code>filename</code> - the filename to query, null returns false</dd>
  1414. <dd><code>extensions</code> - the extensions to check for, null checks for no extension</dd>
  1415. <dt><span class="returnLabel">Returns:</span></dt>
  1416. <dd>true if the filename is one of the extensions</dd>
  1417. <dt><span class="throwsLabel">Throws:</span></dt>
  1418. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the supplied filename contains null bytes</dd>
  1419. </dl>
  1420. </li>
  1421. </ul>
  1422. <a name="isExtension-java.lang.String-java.util.Collection-">
  1423. <!-- -->
  1424. </a>
  1425. <ul class="blockList">
  1426. <li class="blockList">
  1427. <h4>isExtension</h4>
  1428. <pre>public static&nbsp;boolean&nbsp;isExtension(<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,
  1429. <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</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>&gt;&nbsp;extensions)</pre>
  1430. <div class="block">Checks whether the extension of the filename is one of those specified.
  1431. <p>
  1432. This method obtains the extension as the textual part of the filename
  1433. after the last dot. There must be no directory separator after the dot.
  1434. The extension check is case-sensitive on all platforms.</div>
  1435. <dl>
  1436. <dt><span class="paramLabel">Parameters:</span></dt>
  1437. <dd><code>filename</code> - the filename to query, null returns false</dd>
  1438. <dd><code>extensions</code> - the extensions to check for, null checks for no extension</dd>
  1439. <dt><span class="returnLabel">Returns:</span></dt>
  1440. <dd>true if the filename is one of the extensions</dd>
  1441. <dt><span class="throwsLabel">Throws:</span></dt>
  1442. <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the supplied filename contains null bytes</dd>
  1443. </dl>
  1444. </li>
  1445. </ul>
  1446. <a name="wildcardMatch-java.lang.String-java.lang.String-">
  1447. <!-- -->
  1448. </a>
  1449. <ul class="blockList">
  1450. <li class="blockList">
  1451. <h4>wildcardMatch</h4>
  1452. <pre>public static&nbsp;boolean&nbsp;wildcardMatch(<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,
  1453. <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;wildcardMatcher)</pre>
  1454. <div class="block">Checks a filename to see if it matches the specified wildcard matcher,
  1455. always testing case-sensitive.
  1456. <p>
  1457. The wildcard matcher uses the characters '?' and '*' to represent a
  1458. single or multiple (zero or more) wildcard characters.
  1459. This is the same as often found on Dos/Unix command lines.
  1460. The check is case-sensitive always.
  1461. <pre>
  1462. wildcardMatch("c.txt", "*.txt") --&gt; true
  1463. wildcardMatch("c.txt", "*.jpg") --&gt; false
  1464. wildcardMatch("a/b/c.txt", "a/b/*") --&gt; true
  1465. wildcardMatch("c.txt", "*.???") --&gt; true
  1466. wildcardMatch("c.txt", "*.????") --&gt; false
  1467. </pre>
  1468. N.B. the sequence "*?" does not work properly at present in match strings.</div>
  1469. <dl>
  1470. <dt><span class="paramLabel">Parameters:</span></dt>
  1471. <dd><code>filename</code> - the filename to match on</dd>
  1472. <dd><code>wildcardMatcher</code> - the wildcard string to match against</dd>
  1473. <dt><span class="returnLabel">Returns:</span></dt>
  1474. <dd>true if the filename matches the wildcard string</dd>
  1475. <dt><span class="seeLabel">See Also:</span></dt>
  1476. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SENSITIVE"><code>IOCase.SENSITIVE</code></a></dd>
  1477. </dl>
  1478. </li>
  1479. </ul>
  1480. <a name="wildcardMatchOnSystem-java.lang.String-java.lang.String-">
  1481. <!-- -->
  1482. </a>
  1483. <ul class="blockList">
  1484. <li class="blockList">
  1485. <h4>wildcardMatchOnSystem</h4>
  1486. <pre>public static&nbsp;boolean&nbsp;wildcardMatchOnSystem(<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,
  1487. <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;wildcardMatcher)</pre>
  1488. <div class="block">Checks a filename to see if it matches the specified wildcard matcher
  1489. using the case rules of the system.
  1490. <p>
  1491. The wildcard matcher uses the characters '?' and '*' to represent a
  1492. single or multiple (zero or more) wildcard characters.
  1493. This is the same as often found on Dos/Unix command lines.
  1494. The check is case-sensitive on Unix and case-insensitive on Windows.
  1495. <pre>
  1496. wildcardMatch("c.txt", "*.txt") --&gt; true
  1497. wildcardMatch("c.txt", "*.jpg") --&gt; false
  1498. wildcardMatch("a/b/c.txt", "a/b/*") --&gt; true
  1499. wildcardMatch("c.txt", "*.???") --&gt; true
  1500. wildcardMatch("c.txt", "*.????") --&gt; false
  1501. </pre>
  1502. N.B. the sequence "*?" does not work properly at present in match strings.</div>
  1503. <dl>
  1504. <dt><span class="paramLabel">Parameters:</span></dt>
  1505. <dd><code>filename</code> - the filename to match on</dd>
  1506. <dd><code>wildcardMatcher</code> - the wildcard string to match against</dd>
  1507. <dt><span class="returnLabel">Returns:</span></dt>
  1508. <dd>true if the filename matches the wildcard string</dd>
  1509. <dt><span class="seeLabel">See Also:</span></dt>
  1510. <dd><a href="../../../../org/apache/commons/io/IOCase.html#SYSTEM"><code>IOCase.SYSTEM</code></a></dd>
  1511. </dl>
  1512. </li>
  1513. </ul>
  1514. <a name="wildcardMatch-java.lang.String-java.lang.String-org.apache.commons.io.IOCase-">
  1515. <!-- -->
  1516. </a>
  1517. <ul class="blockListLast">
  1518. <li class="blockList">
  1519. <h4>wildcardMatch</h4>
  1520. <pre>public static&nbsp;boolean&nbsp;wildcardMatch(<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,
  1521. <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;wildcardMatcher,
  1522. <a href="../../../../org/apache/commons/io/IOCase.html" title="enum in org.apache.commons.io">IOCase</a>&nbsp;caseSensitivity)</pre>
  1523. <div class="block">Checks a filename to see if it matches the specified wildcard matcher
  1524. allowing control over case-sensitivity.
  1525. <p>
  1526. The wildcard matcher uses the characters '?' and '*' to represent a
  1527. single or multiple (zero or more) wildcard characters.
  1528. N.B. the sequence "*?" does not work properly at present in match strings.</div>
  1529. <dl>
  1530. <dt><span class="paramLabel">Parameters:</span></dt>
  1531. <dd><code>filename</code> - the filename to match on</dd>
  1532. <dd><code>wildcardMatcher</code> - the wildcard string to match against</dd>
  1533. <dd><code>caseSensitivity</code> - what case sensitivity rule to use, null means case-sensitive</dd>
  1534. <dt><span class="returnLabel">Returns:</span></dt>
  1535. <dd>true if the filename matches the wildcard string</dd>
  1536. <dt><span class="simpleTagLabel">Since:</span></dt>
  1537. <dd>1.3</dd>
  1538. </dl>
  1539. </li>
  1540. </ul>
  1541. </li>
  1542. </ul>
  1543. </li>
  1544. </ul>
  1545. </div>
  1546. </div>
  1547. <!-- ========= END OF CLASS DATA ========= -->
  1548. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  1549. <div class="bottomNav"><a name="navbar.bottom">
  1550. <!-- -->
  1551. </a>
  1552. <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
  1553. <a name="navbar.bottom.firstrow">
  1554. <!-- -->
  1555. </a>
  1556. <ul class="navList" title="Navigation">
  1557. <li><a href="../../../../overview-summary.html">Overview</a></li>
  1558. <li><a href="package-summary.html">Package</a></li>
  1559. <li class="navBarCell1Rev">Class</li>
  1560. <li><a href="class-use/FilenameUtils.html">Use</a></li>
  1561. <li><a href="package-tree.html">Tree</a></li>
  1562. <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
  1563. <li><a href="../../../../index-all.html">Index</a></li>
  1564. <li><a href="../../../../help-doc.html">Help</a></li>
  1565. </ul>
  1566. </div>
  1567. <div class="subNav">
  1568. <ul class="navList">
  1569. <li><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
  1570. <li><a href="../../../../org/apache/commons/io/FileSystemUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
  1571. </ul>
  1572. <ul class="navList">
  1573. <li><a href="../../../../index.html?org/apache/commons/io/FilenameUtils.html" target="_top">Frames</a></li>
  1574. <li><a href="FilenameUtils.html" target="_top">No&nbsp;Frames</a></li>
  1575. </ul>
  1576. <ul class="navList" id="allclasses_navbar_bottom">
  1577. <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
  1578. </ul>
  1579. <div>
  1580. <script type="text/javascript"><!--
  1581. allClassesLink = document.getElementById("allclasses_navbar_bottom");
  1582. if(window==top) {
  1583. allClassesLink.style.display = "block";
  1584. }
  1585. else {
  1586. allClassesLink.style.display = "none";
  1587. }
  1588. //-->
  1589. </script>
  1590. </div>
  1591. <div>
  1592. <ul class="subNavList">
  1593. <li>Summary:&nbsp;</li>
  1594. <li>Nested&nbsp;|&nbsp;</li>
  1595. <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
  1596. <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
  1597. <li><a href="#method.summary">Method</a></li>
  1598. </ul>
  1599. <ul class="subNavList">
  1600. <li>Detail:&nbsp;</li>
  1601. <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
  1602. <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
  1603. <li><a href="#method.detail">Method</a></li>
  1604. </ul>
  1605. </div>
  1606. <a name="skip.navbar.bottom">
  1607. <!-- -->
  1608. </a></div>
  1609. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  1610. <p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
  1611. </body>
  1612. </html>