123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!-- NewPage -->
- <html lang="de">
- <head>
- <!-- Generated by javadoc -->
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>FileUtils (Apache Commons IO 2.6 API)</title>
- <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
- <script type="text/javascript" src="../../../../script.js"></script>
- </head>
- <body>
- <script type="text/javascript"><!--
- try {
- if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="FileUtils (Apache Commons IO 2.6 API)";
- }
- }
- catch(err) {
- }
- //-->
- 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,"i32":9,"i33":9,"i34":9,"i35":9,"i36":9,"i37":9,"i38":9,"i39":9,"i40":9,"i41":9,"i42":9,"i43":9,"i44":9,"i45":9,"i46":9,"i47":9,"i48":9,"i49":9,"i50":9,"i51":9,"i52":9,"i53":9,"i54":9,"i55":9,"i56":9,"i57":9,"i58":9,"i59":9,"i60":9,"i61":41,"i62":9,"i63":9,"i64":41,"i65":9,"i66":9,"i67":9,"i68":9,"i69":9,"i70":9,"i71":9,"i72":9,"i73":9,"i74":9,"i75":9,"i76":41,"i77":41,"i78":9,"i79":9,"i80":9,"i81":9,"i82":9,"i83":9,"i84":9,"i85":9,"i86":9,"i87":9,"i88":9,"i89":9,"i90":9,"i91":9,"i92":9,"i93":9,"i94":41,"i95":41,"i96":9,"i97":9,"i98":9,"i99":9};
- var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
- var altColor = "altColor";
- var rowColor = "rowColor";
- var tableTab = "tableTab";
- var activeTableTab = "activeTableTab";
- </script>
- <noscript>
- <div>JavaScript is disabled on your browser.</div>
- </noscript>
- <!-- ========= START OF TOP NAVBAR ======= -->
- <div class="topNav"><a name="navbar.top">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
- <a name="navbar.top.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../../../../overview-summary.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/FileUtils.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
- <li><a href="../../../../index-all.html">Index</a></li>
- <li><a href="../../../../help-doc.html">Help</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../../../org/apache/commons/io/FileSystemUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../../../../org/apache/commons/io/HexDump.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../../../../index.html?org/apache/commons/io/FileUtils.html" target="_top">Frames</a></li>
- <li><a href="FileUtils.html" target="_top">No Frames</a></li>
- </ul>
- <ul class="navList" id="allclasses_navbar_top">
- <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
- </ul>
- <div>
- <script type="text/javascript"><!--
- allClassesLink = document.getElementById("allclasses_navbar_top");
- if(window==top) {
- allClassesLink.style.display = "block";
- }
- else {
- allClassesLink.style.display = "none";
- }
- //-->
- </script>
- </div>
- <div>
- <ul class="subNavList">
- <li>Summary: </li>
- <li>Nested | </li>
- <li><a href="#field.summary">Field</a> | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li><a href="#field.detail">Field</a> | </li>
- <li><a href="#constructor.detail">Constr</a> | </li>
- <li><a href="#method.detail">Method</a></li>
- </ul>
- </div>
- <a name="skip.navbar.top">
- <!-- -->
- </a></div>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <!-- ======== START OF CLASS DATA ======== -->
- <div class="header">
- <div class="subTitle">org.apache.commons.io</div>
- <h2 title="Class FileUtils" class="title">Class FileUtils</h2>
- </div>
- <div class="contentContainer">
- <ul class="inheritance">
- <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>
- <li>
- <ul class="inheritance">
- <li>org.apache.commons.io.FileUtils</li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <hr>
- <br>
- <pre>public class <span class="typeNameLabel">FileUtils</span>
- 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>
- <div class="block">General file manipulation utilities.
- <p>
- Facilities are provided in the following areas:
- <ul>
- <li>writing to a file
- <li>reading from a file
- <li>make a directory including parent directories
- <li>copying files and directories
- <li>deleting files and directories
- <li>converting to and from a URL
- <li>listing files and directories by filter and extension
- <li>comparing file content
- <li>file last changed date
- <li>calculating a checksum
- </ul>
- <p>
- Note that a specific charset should be specified whenever possible.
- Relying on the platform default means that the code is Locale-dependent.
- Only use the default if the files are known to always use the platform default.
- <p>
- Origin of code: Excalibur, Alexandria, Commons-Utils</div>
- </li>
- </ul>
- </div>
- <div class="summary">
- <ul class="blockList">
- <li class="blockList">
- <!-- =========== FIELD SUMMARY =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="field.summary">
- <!-- -->
- </a>
- <h3>Field Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
- <caption><span>Fields</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Field and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#EMPTY_FILE_ARRAY">EMPTY_FILE_ARRAY</a></span></code>
- <div class="block">An empty array of type <code>File</code>.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_EB">ONE_EB</a></span></code>
- <div class="block">The number of bytes in an exabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_EB_BI">ONE_EB_BI</a></span></code>
- <div class="block">The number of bytes in an exabyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_GB">ONE_GB</a></span></code>
- <div class="block">The number of bytes in a gigabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_GB_BI">ONE_GB_BI</a></span></code>
- <div class="block">The number of bytes in a gigabyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_KB">ONE_KB</a></span></code>
- <div class="block">The number of bytes in a kilobyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_KB_BI">ONE_KB_BI</a></span></code>
- <div class="block">The number of bytes in a kilobyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_MB">ONE_MB</a></span></code>
- <div class="block">The number of bytes in a megabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_MB_BI">ONE_MB_BI</a></span></code>
- <div class="block">The number of bytes in a megabyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_PB">ONE_PB</a></span></code>
- <div class="block">The number of bytes in a petabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_PB_BI">ONE_PB_BI</a></span></code>
- <div class="block">The number of bytes in a petabyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_TB">ONE_TB</a></span></code>
- <div class="block">The number of bytes in a terabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_TB_BI">ONE_TB_BI</a></span></code>
- <div class="block">The number of bytes in a terabyte.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_YB">ONE_YB</a></span></code>
- <div class="block">The number of bytes in a yottabyte.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#ONE_ZB">ONE_ZB</a></span></code>
- <div class="block">The number of bytes in a zettabyte.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor.summary">
- <!-- -->
- </a>
- <h3>Constructor Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
- <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colOne" scope="col">Constructor and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#FileUtils--">FileUtils</a></span>()</code>
- <div class="block">Instances should NOT be constructed in standard programming.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ========== METHOD SUMMARY =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method.summary">
- <!-- -->
- </a>
- <h3>Method Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
- <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Method and Description</th>
- </tr>
- <tr id="i0" class="altColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#byteCountToDisplaySize-java.math.BigInteger-">byteCountToDisplaySize</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> size)</code>
- <div class="block">Returns a human-readable version of the file size, where the input represents a specific number of bytes.</div>
- </td>
- </tr>
- <tr id="i1" class="rowColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#byteCountToDisplaySize-long-">byteCountToDisplaySize</a></span>(long size)</code>
- <div class="block">Returns a human-readable version of the file size, where the input represents a specific number of bytes.</div>
- </td>
- </tr>
- <tr id="i2" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Checksum.html?is-external=true" title="class or interface in java.util.zip">Checksum</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#checksum-java.io.File-java.util.zip.Checksum-">checksum</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Checksum.html?is-external=true" title="class or interface in java.util.zip">Checksum</a> checksum)</code>
- <div class="block">Computes the checksum of a file using the specified checksum object.</div>
- </td>
- </tr>
- <tr id="i3" class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#checksumCRC32-java.io.File-">checksumCRC32</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Computes the checksum of a file using the CRC32 checksum routine.</div>
- </td>
- </tr>
- <tr id="i4" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#cleanDirectory-java.io.File-">cleanDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
- <div class="block">Cleans a directory without deleting it.</div>
- </td>
- </tr>
- <tr id="i5" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#contentEquals-java.io.File-java.io.File-">contentEquals</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file1,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file2)</code>
- <div class="block">Compares the contents of two files to determine if they are equal or not.</div>
- </td>
- </tr>
- <tr id="i6" class="altColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#contentEqualsIgnoreEOL-java.io.File-java.io.File-java.lang.String-">contentEqualsIgnoreEOL</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file1,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file2,
- <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> charsetName)</code>
- <div class="block">Compares the contents of two files to determine if they are equal or not.</div>
- </td>
- </tr>
- <tr id="i7" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#convertFileCollectionToFileArray-java.util.Collection-">convertFileCollectionToFileArray</a></span>(<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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> files)</code>
- <div class="block">Converts a Collection containing java.io.File instanced into array
- representation.</div>
- </td>
- </tr>
- <tr id="i8" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectory-java.io.File-java.io.File-">copyDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Copies a whole directory to a new location preserving the file dates.</div>
- </td>
- </tr>
- <tr id="i9" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectory-java.io.File-java.io.File-boolean-">copyDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean preserveFileDate)</code>
- <div class="block">Copies a whole directory to a new location.</div>
- </td>
- </tr>
- <tr id="i10" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectory-java.io.File-java.io.File-java.io.FileFilter-">copyDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter)</code>
- <div class="block">Copies a filtered directory to a new location preserving the file dates.</div>
- </td>
- </tr>
- <tr id="i11" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectory-java.io.File-java.io.File-java.io.FileFilter-boolean-">copyDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter,
- boolean preserveFileDate)</code>
- <div class="block">Copies a filtered directory to a new location.</div>
- </td>
- </tr>
- <tr id="i12" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectoryToDirectory-java.io.File-java.io.File-">copyDirectoryToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Copies a directory to within another directory preserving the file dates.</div>
- </td>
- </tr>
- <tr id="i13" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.File-">copyFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile)</code>
- <div class="block">Copies a file to a new location preserving the file date.</div>
- </td>
- </tr>
- <tr id="i14" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.File-boolean-">copyFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile,
- boolean preserveFileDate)</code>
- <div class="block">Copies a file to a new location.</div>
- </td>
- </tr>
- <tr id="i15" class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.OutputStream-">copyFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> input,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> output)</code>
- <div class="block">Copy bytes from a <code>File</code> to an <code>OutputStream</code>.</div>
- </td>
- </tr>
- <tr id="i16" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-">copyFileToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Copies a file to a directory preserving the file date.</div>
- </td>
- </tr>
- <tr id="i17" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-boolean-">copyFileToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean preserveFileDate)</code>
- <div class="block">Copies a file to a directory optionally preserving the file date.</div>
- </td>
- </tr>
- <tr id="i18" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyInputStreamToFile-java.io.InputStream-java.io.File-">copyInputStreamToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)</code>
- <div class="block">Copies bytes from an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> <code>source</code> to a file
- <code>destination</code>.</div>
- </td>
- </tr>
- <tr id="i19" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyToDirectory-java.io.File-java.io.File-">copyToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Copies a file or directory to within another directory preserving the file dates.</div>
- </td>
- </tr>
- <tr id="i20" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyToDirectory-java.lang.Iterable-java.io.File-">copyToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> srcs,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Copies a files to a directory preserving each file's date.</div>
- </td>
- </tr>
- <tr id="i21" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyToFile-java.io.InputStream-java.io.File-">copyToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)</code>
- <div class="block">Copies bytes from an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> <code>source</code> to a file
- <code>destination</code>.</div>
- </td>
- </tr>
- <tr id="i22" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-">copyURLToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)</code>
- <div class="block">Copies bytes from the URL <code>source</code> to a file
- <code>destination</code>.</div>
- </td>
- </tr>
- <tr id="i23" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-int-int-">copyURLToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination,
- int connectionTimeout,
- int readTimeout)</code>
- <div class="block">Copies bytes from the URL <code>source</code> to a file
- <code>destination</code>.</div>
- </td>
- </tr>
- <tr id="i24" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#deleteDirectory-java.io.File-">deleteDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
- <div class="block">Deletes a directory recursively.</div>
- </td>
- </tr>
- <tr id="i25" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#deleteQuietly-java.io.File-">deleteQuietly</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Deletes a file, never throwing an exception.</div>
- </td>
- </tr>
- <tr id="i26" class="altColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#directoryContains-java.io.File-java.io.File-">directoryContains</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> child)</code>
- <div class="block">Determines whether the <code>parent</code> directory contains the <code>child</code> element (a file or directory).</div>
- </td>
- </tr>
- <tr id="i27" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#forceDelete-java.io.File-">forceDelete</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Deletes a file.</div>
- </td>
- </tr>
- <tr id="i28" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#forceDeleteOnExit-java.io.File-">forceDeleteOnExit</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Schedules a file to be deleted when JVM exits.</div>
- </td>
- </tr>
- <tr id="i29" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#forceMkdir-java.io.File-">forceMkdir</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
- <div class="block">Makes a directory, including any necessary but nonexistent parent
- directories.</div>
- </td>
- </tr>
- <tr id="i30" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#forceMkdirParent-java.io.File-">forceMkdirParent</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Makes any necessary but nonexistent parent directories for a given File.</div>
- </td>
- </tr>
- <tr id="i31" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getFile-java.io.File-java.lang.String...-">getFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>... names)</code>
- <div class="block">Construct a file from the set of name elements.</div>
- </td>
- </tr>
- <tr id="i32" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getFile-java.lang.String...-">getFile</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>... names)</code>
- <div class="block">Construct a file from the set of name elements.</div>
- </td>
- </tr>
- <tr id="i33" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getTempDirectory--">getTempDirectory</a></span>()</code>
- <div class="block">Returns a <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> representing the system temporary directory.</div>
- </td>
- </tr>
- <tr id="i34" class="altColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getTempDirectoryPath--">getTempDirectoryPath</a></span>()</code>
- <div class="block">Returns the path to the system temporary directory.</div>
- </td>
- </tr>
- <tr id="i35" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getUserDirectory--">getUserDirectory</a></span>()</code>
- <div class="block">Returns a <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> representing the user's home directory.</div>
- </td>
- </tr>
- <tr id="i36" class="altColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#getUserDirectoryPath--">getUserDirectoryPath</a></span>()</code>
- <div class="block">Returns the path to the user's home directory.</div>
- </td>
- </tr>
- <tr id="i37" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileNewer-java.io.File-java.util.Date-">isFileNewer</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a> date)</code>
- <div class="block">Tests if the specified <code>File</code> is newer than the specified
- <code>Date</code>.</div>
- </td>
- </tr>
- <tr id="i38" class="altColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileNewer-java.io.File-java.io.File-">isFileNewer</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> reference)</code>
- <div class="block">Tests if the specified <code>File</code> is newer than the reference
- <code>File</code>.</div>
- </td>
- </tr>
- <tr id="i39" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileNewer-java.io.File-long-">isFileNewer</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- long timeMillis)</code>
- <div class="block">Tests if the specified <code>File</code> is newer than the specified
- time reference.</div>
- </td>
- </tr>
- <tr id="i40" class="altColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileOlder-java.io.File-java.util.Date-">isFileOlder</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a> date)</code>
- <div class="block">Tests if the specified <code>File</code> is older than the specified
- <code>Date</code>.</div>
- </td>
- </tr>
- <tr id="i41" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileOlder-java.io.File-java.io.File-">isFileOlder</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> reference)</code>
- <div class="block">Tests if the specified <code>File</code> is older than the reference
- <code>File</code>.</div>
- </td>
- </tr>
- <tr id="i42" class="altColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isFileOlder-java.io.File-long-">isFileOlder</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- long timeMillis)</code>
- <div class="block">Tests if the specified <code>File</code> is older than the specified
- time reference.</div>
- </td>
- </tr>
- <tr id="i43" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#isSymlink-java.io.File-">isSymlink</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Determines whether the specified file is a Symbolic Link rather than an actual file.</div>
- </td>
- </tr>
- <tr id="i44" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#iterateFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">iterateFiles</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</code>
- <div class="block">Allows iteration over the files in given directory (and optionally
- its subdirectories).</div>
- </td>
- </tr>
- <tr id="i45" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#iterateFiles-java.io.File-java.lang.String:A-boolean-">iterateFiles</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>[] extensions,
- boolean recursive)</code>
- <div class="block">Allows iteration over the files in a given directory (and optionally
- its subdirectories) which match an array of extensions.</div>
- </td>
- </tr>
- <tr id="i46" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#iterateFilesAndDirs-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">iterateFilesAndDirs</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</code>
- <div class="block">Allows iteration over the files in given directory (and optionally
- its subdirectories).</div>
- </td>
- </tr>
- <tr id="i47" class="rowColor">
- <td class="colFirst"><code>static <a href="../../../../org/apache/commons/io/LineIterator.html" title="class in org.apache.commons.io">LineIterator</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#lineIterator-java.io.File-">lineIterator</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Returns an Iterator for the lines in a <code>File</code> using the default encoding for the VM.</div>
- </td>
- </tr>
- <tr id="i48" class="altColor">
- <td class="colFirst"><code>static <a href="../../../../org/apache/commons/io/LineIterator.html" title="class in org.apache.commons.io">LineIterator</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#lineIterator-java.io.File-java.lang.String-">lineIterator</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)</code>
- <div class="block">Returns an Iterator for the lines in a <code>File</code>.</div>
- </td>
- </tr>
- <tr id="i49" class="rowColor">
- <td class="colFirst"><code>static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#listFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">listFiles</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</code>
- <div class="block">Finds files within a given directory (and optionally its
- subdirectories).</div>
- </td>
- </tr>
- <tr id="i50" class="altColor">
- <td class="colFirst"><code>static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#listFiles-java.io.File-java.lang.String:A-boolean-">listFiles</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>[] extensions,
- boolean recursive)</code>
- <div class="block">Finds files within a given directory (and optionally its subdirectories)
- which match an array of extensions.</div>
- </td>
- </tr>
- <tr id="i51" class="rowColor">
- <td class="colFirst"><code>static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#listFilesAndDirs-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">listFilesAndDirs</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</code>
- <div class="block">Finds files within a given directory (and optionally its
- subdirectories).</div>
- </td>
- </tr>
- <tr id="i52" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#moveDirectory-java.io.File-java.io.File-">moveDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)</code>
- <div class="block">Moves a directory.</div>
- </td>
- </tr>
- <tr id="i53" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#moveDirectoryToDirectory-java.io.File-java.io.File-boolean-">moveDirectoryToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)</code>
- <div class="block">Moves a directory to another directory.</div>
- </td>
- </tr>
- <tr id="i54" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#moveFile-java.io.File-java.io.File-">moveFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile)</code>
- <div class="block">Moves a file.</div>
- </td>
- </tr>
- <tr id="i55" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#moveFileToDirectory-java.io.File-java.io.File-boolean-">moveFileToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)</code>
- <div class="block">Moves a file to a directory.</div>
- </td>
- </tr>
- <tr id="i56" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#moveToDirectory-java.io.File-java.io.File-boolean-">moveToDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)</code>
- <div class="block">Moves a file or directory to the destination directory.</div>
- </td>
- </tr>
- <tr id="i57" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html?is-external=true" title="class or interface in java.io">FileInputStream</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#openInputStream-java.io.File-">openInputStream</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html?is-external=true" title="class or interface in java.io"><code>FileInputStream</code></a> for the specified file, providing better
- error messages than simply calling <code>new FileInputStream(file)</code>.</div>
- </td>
- </tr>
- <tr id="i58" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io">FileOutputStream</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#openOutputStream-java.io.File-">openOutputStream</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file, checking and
- creating the parent directory if it does not exist.</div>
- </td>
- </tr>
- <tr id="i59" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io">FileOutputStream</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#openOutputStream-java.io.File-boolean-">openOutputStream</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- boolean append)</code>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file, checking and
- creating the parent directory if it does not exist.</div>
- </td>
- </tr>
- <tr id="i60" class="altColor">
- <td class="colFirst"><code>static byte[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readFileToByteArray-java.io.File-">readFileToByteArray</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Reads the contents of a file into a byte array.</div>
- </td>
- </tr>
- <tr id="i61" class="rowColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readFileToString-java.io.File-">readFileToString</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#readFileToString-java.io.File-java.nio.charset.Charset-"><code>readFileToString(File, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i62" class="altColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readFileToString-java.io.File-java.nio.charset.Charset-">readFileToString</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)</code>
- <div class="block">Reads the contents of a file into a String.</div>
- </td>
- </tr>
- <tr id="i63" class="rowColor">
- <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>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readFileToString-java.io.File-java.lang.String-">readFileToString</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)</code>
- <div class="block">Reads the contents of a file into a String.</div>
- </td>
- </tr>
- <tr id="i64" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readLines-java.io.File-">readLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#readLines-java.io.File-java.nio.charset.Charset-"><code>readLines(File, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i65" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readLines-java.io.File-java.nio.charset.Charset-">readLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)</code>
- <div class="block">Reads the contents of a file line by line to a List of Strings.</div>
- </td>
- </tr>
- <tr id="i66" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#readLines-java.io.File-java.lang.String-">readLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)</code>
- <div class="block">Reads the contents of a file line by line to a List of Strings.</div>
- </td>
- </tr>
- <tr id="i67" class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#sizeOf-java.io.File-">sizeOf</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Returns the size of the specified file or directory.</div>
- </td>
- </tr>
- <tr id="i68" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#sizeOfAsBigInteger-java.io.File-">sizeOfAsBigInteger</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Returns the size of the specified file or directory.</div>
- </td>
- </tr>
- <tr id="i69" class="rowColor">
- <td class="colFirst"><code>static long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#sizeOfDirectory-java.io.File-">sizeOfDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
- <div class="block">Counts the size of a directory recursively (sum of the length of all files).</div>
- </td>
- </tr>
- <tr id="i70" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#sizeOfDirectoryAsBigInteger-java.io.File-">sizeOfDirectoryAsBigInteger</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
- <div class="block">Counts the size of a directory recursively (sum of the length of all files).</div>
- </td>
- </tr>
- <tr id="i71" class="rowColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#toFile-java.net.URL-">toFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> url)</code>
- <div class="block">Convert from a <code>URL</code> to a <code>File</code>.</div>
- </td>
- </tr>
- <tr id="i72" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#toFiles-java.net.URL:A-">toFiles</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>[] urls)</code>
- <div class="block">Converts each of an array of <code>URL</code> to a <code>File</code>.</div>
- </td>
- </tr>
- <tr id="i73" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#touch-java.io.File-">touch</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code>
- <div class="block">Implements the same behaviour as the "touch" utility on Unix.</div>
- </td>
- </tr>
- <tr id="i74" class="altColor">
- <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>[]</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#toURLs-java.io.File:A-">toURLs</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] files)</code>
- <div class="block">Converts each of an array of <code>File</code> to a <code>URL</code>.</div>
- </td>
- </tr>
- <tr id="i75" class="rowColor">
- <td class="colFirst"><code>static boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#waitFor-java.io.File-int-">waitFor</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int seconds)</code>
- <div class="block">Waits for NFS to propagate a file creation, imposing a timeout.</div>
- </td>
- </tr>
- <tr id="i76" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-"><code>write(File, CharSequence, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i77" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-boolean-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- boolean append)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-boolean-"><code>write(File, CharSequence, Charset, boolean)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i78" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)</code>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i79" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-boolean-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding,
- boolean append)</code>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i80" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.lang.String-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <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> encoding)</code>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i81" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.lang.String-boolean-">write</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <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> encoding,
- boolean append)</code>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i82" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeByteArrayToFile-java.io.File-byte:A-">writeByteArrayToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data)</code>
- <div class="block">Writes a byte array to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i83" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeByteArrayToFile-java.io.File-byte:A-boolean-">writeByteArrayToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- boolean append)</code>
- <div class="block">Writes a byte array to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i84" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeByteArrayToFile-java.io.File-byte:A-int-int-">writeByteArrayToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- int off,
- int len)</code>
- <div class="block">Writes <code>len</code> bytes from the specified byte array starting
- at offset <code>off</code> to a file, creating the file if it does
- not exist.</div>
- </td>
- </tr>
- <tr id="i85" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeByteArrayToFile-java.io.File-byte:A-int-int-boolean-">writeByteArrayToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- int off,
- int len,
- boolean append)</code>
- <div class="block">Writes <code>len</code> bytes from the specified byte array starting
- at offset <code>off</code> to a file, creating the file if it does
- not exist.</div>
- </td>
- </tr>
- <tr id="i86" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.util.Collection-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i87" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.util.Collection-boolean-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- boolean append)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i88" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.util.Collection-java.lang.String-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- <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> lineEnding)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i89" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.util.Collection-java.lang.String-boolean-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- <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> lineEnding,
- boolean append)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i90" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.lang.String-java.util.Collection-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i91" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.lang.String-java.util.Collection-boolean-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- boolean append)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line, optionally appending.</div>
- </td>
- </tr>
- <tr id="i92" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.lang.String-java.util.Collection-java.lang.String-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- <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> lineEnding)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i93" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeLines-java.io.File-java.lang.String-java.util.Collection-java.lang.String-boolean-">writeLines</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- <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> lineEnding,
- boolean append)</code>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.</div>
- </td>
- </tr>
- <tr id="i94" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-"><code>writeStringToFile(File, String, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i95" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-boolean-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- boolean append)</code>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span>
- <div class="block"><span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-boolean-"><code>writeStringToFile(File, String, Charset, boolean)</code></a> instead (and specify the appropriate encoding)</span></div>
- </div>
- </td>
- </tr>
- <tr id="i96" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)</code>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i97" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-boolean-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding,
- boolean append)</code>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i98" class="altColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.lang.String-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <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> encoding)</code>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- <tr id="i99" class="rowColor">
- <td class="colFirst"><code>static void</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.lang.String-boolean-">writeStringToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <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> encoding,
- boolean append)</code>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- </td>
- </tr>
- </table>
- <ul class="blockList">
- <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
- <!-- -->
- </a>
- <h3>Methods inherited from class 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>
- <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>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="details">
- <ul class="blockList">
- <li class="blockList">
- <!-- ============ FIELD DETAIL =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="field.detail">
- <!-- -->
- </a>
- <h3>Field Detail</h3>
- <a name="ONE_KB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_KB</h4>
- <pre>public static final long ONE_KB</pre>
- <div class="block">The number of bytes in a kilobyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_KB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_KB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_KB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_KB_BI</pre>
- <div class="block">The number of bytes in a kilobyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_MB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_MB</h4>
- <pre>public static final long ONE_MB</pre>
- <div class="block">The number of bytes in a megabyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_MB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_MB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_MB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_MB_BI</pre>
- <div class="block">The number of bytes in a megabyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_GB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_GB</h4>
- <pre>public static final long ONE_GB</pre>
- <div class="block">The number of bytes in a gigabyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_GB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_GB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_GB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_GB_BI</pre>
- <div class="block">The number of bytes in a gigabyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_TB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_TB</h4>
- <pre>public static final long ONE_TB</pre>
- <div class="block">The number of bytes in a terabyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_TB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_TB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_TB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_TB_BI</pre>
- <div class="block">The number of bytes in a terabyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_PB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_PB</h4>
- <pre>public static final long ONE_PB</pre>
- <div class="block">The number of bytes in a petabyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_PB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_PB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_PB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_PB_BI</pre>
- <div class="block">The number of bytes in a petabyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_EB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_EB</h4>
- <pre>public static final long ONE_EB</pre>
- <div class="block">The number of bytes in an exabyte.</div>
- <dl>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../constant-values.html#org.apache.commons.io.FileUtils.ONE_EB">Constant Field Values</a></dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_EB_BI">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_EB_BI</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_EB_BI</pre>
- <div class="block">The number of bytes in an exabyte.</div>
- <dl>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="ONE_ZB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_ZB</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_ZB</pre>
- <div class="block">The number of bytes in a zettabyte.</div>
- </li>
- </ul>
- <a name="ONE_YB">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>ONE_YB</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> ONE_YB</pre>
- <div class="block">The number of bytes in a yottabyte.</div>
- </li>
- </ul>
- <a name="EMPTY_FILE_ARRAY">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>EMPTY_FILE_ARRAY</h4>
- <pre>public static final <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] EMPTY_FILE_ARRAY</pre>
- <div class="block">An empty array of type <code>File</code>.</div>
- </li>
- </ul>
- </li>
- </ul>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor.detail">
- <!-- -->
- </a>
- <h3>Constructor Detail</h3>
- <a name="FileUtils--">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>FileUtils</h4>
- <pre>public FileUtils()</pre>
- <div class="block">Instances should NOT be constructed in standard programming.</div>
- </li>
- </ul>
- </li>
- </ul>
- <!-- ============ METHOD DETAIL ========== -->
- <ul class="blockList">
- <li class="blockList"><a name="method.detail">
- <!-- -->
- </a>
- <h3>Method Detail</h3>
- <a name="getFile-java.io.File-java.lang.String...-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getFile</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> getFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>... names)</pre>
- <div class="block">Construct a file from the set of name elements.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the parent directory</dd>
- <dd><code>names</code> - the name elements</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="getFile-java.lang.String...-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getFile</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> getFile(<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>... names)</pre>
- <div class="block">Construct a file from the set of name elements.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>names</code> - the name elements</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="getTempDirectoryPath--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getTempDirectoryPath</h4>
- <pre>public 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> getTempDirectoryPath()</pre>
- <div class="block">Returns the path to the system temporary directory.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the path to the system temporary directory.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="getTempDirectory--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getTempDirectory</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> getTempDirectory()</pre>
- <div class="block">Returns a <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> representing the system temporary directory.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the system temporary directory.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="getUserDirectoryPath--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getUserDirectoryPath</h4>
- <pre>public 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> getUserDirectoryPath()</pre>
- <div class="block">Returns the path to the user's home directory.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the path to the user's home directory.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="getUserDirectory--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getUserDirectory</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> getUserDirectory()</pre>
- <div class="block">Returns a <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> representing the user's home directory.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the user's home directory.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="openInputStream-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>openInputStream</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html?is-external=true" title="class or interface in java.io">FileInputStream</a> openInputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html?is-external=true" title="class or interface in java.io"><code>FileInputStream</code></a> for the specified file, providing better
- error messages than simply calling <code>new FileInputStream(file)</code>.
- <p>
- At the end of the method either the stream will be successfully opened,
- or an exception will have been thrown.
- <p>
- An exception is thrown if the file does not exist.
- An exception is thrown if the file object exists but is a directory.
- An exception is thrown if the file exists but cannot be read.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to open for input, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a new <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileInputStream.html?is-external=true" title="class or interface in java.io"><code>FileInputStream</code></a> for the specified file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</a></code> - if the file does not exist</dd>
- <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 the file object is a directory</dd>
- <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 the file cannot be read</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="openOutputStream-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>openOutputStream</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io">FileOutputStream</a> openOutputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file, checking and
- creating the parent directory if it does not exist.
- <p>
- At the end of the method either the stream will be successfully opened,
- or an exception will have been thrown.
- <p>
- The parent directory will be created if it does not exist.
- The file will be created if it does not exist.
- An exception is thrown if the file object exists but is a directory.
- An exception is thrown if the file exists but cannot be written to.
- An exception is thrown if the parent directory cannot be created.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to open for output, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a new <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 the file object is a directory</dd>
- <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 the file cannot be written to</dd>
- <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 a parent directory needs creating but that fails</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="openOutputStream-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>openOutputStream</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io">FileOutputStream</a> openOutputStream(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- boolean append)
- 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>
- <div class="block">Opens a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file, checking and
- creating the parent directory if it does not exist.
- <p>
- At the end of the method either the stream will be successfully opened,
- or an exception will have been thrown.
- <p>
- The parent directory will be created if it does not exist.
- The file will be created if it does not exist.
- An exception is thrown if the file object exists but is a directory.
- An exception is thrown if the file exists but cannot be written to.
- An exception is thrown if the parent directory cannot be created.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to open for output, must not be <code>null</code></dd>
- <dd><code>append</code> - if <code>true</code>, then bytes will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a new <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileOutputStream.html?is-external=true" title="class or interface in java.io"><code>FileOutputStream</code></a> for the specified file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 the file object is a directory</dd>
- <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 the file cannot be written to</dd>
- <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 a parent directory needs creating but that fails</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="byteCountToDisplaySize-java.math.BigInteger-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>byteCountToDisplaySize</h4>
- <pre>public 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> byteCountToDisplaySize(<a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> size)</pre>
- <div class="block">Returns a human-readable version of the file size, where the input represents a specific number of bytes.
- <p>
- If the size is over 1GB, the size is returned as the number of whole GB, i.e. the size is rounded down to the
- nearest GB boundary.
- </p>
- <p>
- Similarly for the 1MB and 1KB boundaries.
- </p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>size</code> - the number of bytes</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a human-readable display value (includes units - EB, PB, TB, GB, MB, KB or bytes)</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="https://issues.apache.org/jira/browse/IO-226">IO-226 - should the rounding be changed?</a></dd>
- </dl>
- </li>
- </ul>
- <a name="byteCountToDisplaySize-long-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>byteCountToDisplaySize</h4>
- <pre>public 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> byteCountToDisplaySize(long size)</pre>
- <div class="block">Returns a human-readable version of the file size, where the input represents a specific number of bytes.
- <p>
- If the size is over 1GB, the size is returned as the number of whole GB, i.e. the size is rounded down to the
- nearest GB boundary.
- </p>
- <p>
- Similarly for the 1MB and 1KB boundaries.
- </p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>size</code> - the number of bytes</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a human-readable display value (includes units - EB, PB, TB, GB, MB, KB or bytes)</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="https://issues.apache.org/jira/browse/IO-226">IO-226 - should the rounding be changed?</a></dd>
- </dl>
- </li>
- </ul>
- <a name="touch-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>touch</h4>
- <pre>public static void touch(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Implements the same behaviour as the "touch" utility on Unix. It creates
- a new file with size 0 or, if the file exists already, it is opened and
- closed without modifying it, but updating the file date and time.
- <p>
- NOTE: As from v1.3, this method throws an IOException if the last
- modified date of the file cannot be set. Also, as from v1.3 this method
- creates parent directories if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the File to touch</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 I/O problem occurs</dd>
- </dl>
- </li>
- </ul>
- <a name="convertFileCollectionToFileArray-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>convertFileCollectionToFileArray</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] convertFileCollectionToFileArray(<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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> files)</pre>
- <div class="block">Converts a Collection containing java.io.File instanced into array
- representation. This is to account for the difference between
- File.listFiles() and FileUtils.listFiles().</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>files</code> - a Collection containing java.io.File instances</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an array of java.io.File</dd>
- </dl>
- </li>
- </ul>
- <a name="listFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>listFiles</h4>
- <pre>public static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> listFiles(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</pre>
- <div class="block">Finds files within a given directory (and optionally its
- subdirectories). All files found are filtered by an IOFileFilter.
- <p>
- If your search should recurse into subdirectories you can pass in
- an IOFileFilter for directories. You don't need to bind a
- DirectoryFileFilter (via logical AND) to this filter. This method does
- that for you.
- <p>
- An example: If you want to search through all directories called
- "temp" you pass in <code>FileFilterUtils.NameFileFilter("temp")</code>
- <p>
- Another common usage of this method is find files in a directory
- tree but ignoring the directories generated CVS. You can simply pass
- in <code>FileFilterUtils.makeCVSAware(null)</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>fileFilter</code> - filter to apply when finding files. Must not be <code>null</code>,
- use <a href="../../../../org/apache/commons/io/filefilter/TrueFileFilter.html#INSTANCE"><code>TrueFileFilter.INSTANCE</code></a> to match all files in selected directories.</dd>
- <dd><code>dirFilter</code> - optional filter to apply when finding subdirectories.
- If this parameter is <code>null</code>, subdirectories will not be included in the
- search. Use <a href="../../../../org/apache/commons/io/filefilter/TrueFileFilter.html#INSTANCE"><code>TrueFileFilter.INSTANCE</code></a> to match all directories.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a collection of java.io.File with the matching files</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a>,
- <a href="../../../../org/apache/commons/io/filefilter/NameFileFilter.html" title="class in org.apache.commons.io.filefilter"><code>NameFileFilter</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="listFilesAndDirs-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>listFilesAndDirs</h4>
- <pre>public static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> listFilesAndDirs(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</pre>
- <div class="block">Finds files within a given directory (and optionally its
- subdirectories). All files found are filtered by an IOFileFilter.
- <p>
- The resulting collection includes the starting directory and
- any subdirectories that match the directory filter.
- <p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>fileFilter</code> - filter to apply when finding files.</dd>
- <dd><code>dirFilter</code> - optional filter to apply when finding subdirectories.
- If this parameter is <code>null</code>, subdirectories will not be included in the
- search. Use TrueFileFilter.INSTANCE to match all directories.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a collection of java.io.File with the matching files</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.2</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#listFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-"><code>listFiles(java.io.File, org.apache.commons.io.filefilter.IOFileFilter, org.apache.commons.io.filefilter.IOFileFilter)</code></a>,
- <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a>,
- <a href="../../../../org/apache/commons/io/filefilter/NameFileFilter.html" title="class in org.apache.commons.io.filefilter"><code>NameFileFilter</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="iterateFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>iterateFiles</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> iterateFiles(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</pre>
- <div class="block">Allows iteration over the files in given directory (and optionally
- its subdirectories).
- <p>
- All files found are filtered by an IOFileFilter. This method is
- based on <a href="../../../../org/apache/commons/io/FileUtils.html#listFiles-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-"><code>listFiles(File, IOFileFilter, IOFileFilter)</code></a>,
- which supports Iterable ('foreach' loop).
- <p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>fileFilter</code> - filter to apply when finding files.</dd>
- <dd><code>dirFilter</code> - optional filter to apply when finding subdirectories.
- If this parameter is <code>null</code>, subdirectories will not be included in the
- search. Use TrueFileFilter.INSTANCE to match all directories.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an iterator of java.io.File for the matching files</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.2</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a>,
- <a href="../../../../org/apache/commons/io/filefilter/NameFileFilter.html" title="class in org.apache.commons.io.filefilter"><code>NameFileFilter</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="iterateFilesAndDirs-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>iterateFilesAndDirs</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> iterateFilesAndDirs(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> fileFilter,
- <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a> dirFilter)</pre>
- <div class="block">Allows iteration over the files in given directory (and optionally
- its subdirectories).
- <p>
- All files found are filtered by an IOFileFilter. This method is
- based on <a href="../../../../org/apache/commons/io/FileUtils.html#listFilesAndDirs-java.io.File-org.apache.commons.io.filefilter.IOFileFilter-org.apache.commons.io.filefilter.IOFileFilter-"><code>listFilesAndDirs(File, IOFileFilter, IOFileFilter)</code></a>,
- which supports Iterable ('foreach' loop).
- <p>
- The resulting iterator includes the subdirectories themselves.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>fileFilter</code> - filter to apply when finding files.</dd>
- <dd><code>dirFilter</code> - optional filter to apply when finding subdirectories.
- If this parameter is <code>null</code>, subdirectories will not be included in the
- search. Use TrueFileFilter.INSTANCE to match all directories.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an iterator of java.io.File for the matching files</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.2</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a>,
- <a href="../../../../org/apache/commons/io/filefilter/NameFileFilter.html" title="class in org.apache.commons.io.filefilter"><code>NameFileFilter</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="listFiles-java.io.File-java.lang.String:A-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>listFiles</h4>
- <pre>public static <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><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> listFiles(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>[] extensions,
- boolean recursive)</pre>
- <div class="block">Finds files within a given directory (and optionally its subdirectories)
- which match an array of extensions.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>extensions</code> - an array of extensions, ex. {"java","xml"}. If this
- parameter is <code>null</code>, all files are returned.</dd>
- <dd><code>recursive</code> - if true all subdirectories are searched as well</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a collection of java.io.File with the matching files</dd>
- </dl>
- </li>
- </ul>
- <a name="iterateFiles-java.io.File-java.lang.String:A-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>iterateFiles</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> iterateFiles(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <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>[] extensions,
- boolean recursive)</pre>
- <div class="block">Allows iteration over the files in a given directory (and optionally
- its subdirectories) which match an array of extensions. This method
- is based on <a href="../../../../org/apache/commons/io/FileUtils.html#listFiles-java.io.File-java.lang.String:A-boolean-"><code>listFiles(File, String[], boolean)</code></a>,
- which supports Iterable ('foreach' loop).</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the directory to search in</dd>
- <dd><code>extensions</code> - an array of extensions, ex. {"java","xml"}. If this
- parameter is <code>null</code>, all files are returned.</dd>
- <dd><code>recursive</code> - if true all subdirectories are searched as well</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an iterator of java.io.File with the matching files</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.2</dd>
- </dl>
- </li>
- </ul>
- <a name="contentEquals-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>contentEquals</h4>
- <pre>public static boolean contentEquals(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file1,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file2)
- 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>
- <div class="block">Compares the contents of two files to determine if they are equal or not.
- <p>
- This method checks to see if the two files are different lengths
- or if they point to the same file, before resorting to byte-by-byte
- comparison of the contents.
- <p>
- Code origin: Avalon</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file1</code> - the first file</dd>
- <dd><code>file2</code> - the second file</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the content of the files are equal or they both don't
- exist, false otherwise</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- </dl>
- </li>
- </ul>
- <a name="contentEqualsIgnoreEOL-java.io.File-java.io.File-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>contentEqualsIgnoreEOL</h4>
- <pre>public static boolean contentEqualsIgnoreEOL(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file1,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file2,
- <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> charsetName)
- 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>
- <div class="block">Compares the contents of two files to determine if they are equal or not.
- <p>
- This method checks to see if the two files point to the same file,
- before resorting to line-by-line comparison of the contents.
- <p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file1</code> - the first file</dd>
- <dd><code>file2</code> - the second file</dd>
- <dd><code>charsetName</code> - the character encoding to be used.
- May be null, in which case the platform default is used</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the content of the files are equal or neither exists,
- false otherwise</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.2</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/IOUtils.html#contentEqualsIgnoreEOL-java.io.Reader-java.io.Reader-"><code>IOUtils.contentEqualsIgnoreEOL(Reader, Reader)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="toFile-java.net.URL-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toFile</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> toFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> url)</pre>
- <div class="block">Convert from a <code>URL</code> to a <code>File</code>.
- <p>
- From version 1.1 this method will decode the URL.
- Syntax such as <code>file:///my%20docs/file.txt</code> will be
- correctly decoded to <code>/my docs/file.txt</code>. Starting with version
- 1.5, this method uses UTF-8 to decode percent-encoded octets to characters.
- Additionally, malformed percent-encoded octets are handled leniently by
- passing them through literally.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>url</code> - the file URL to convert, <code>null</code> returns <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the equivalent <code>File</code> object, or <code>null</code>
- if the URL's protocol is not <code>file</code></dd>
- </dl>
- </li>
- </ul>
- <a name="toFiles-java.net.URL:A-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toFiles</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] toFiles(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>[] urls)</pre>
- <div class="block">Converts each of an array of <code>URL</code> to a <code>File</code>.
- <p>
- Returns an array of the same size as the input.
- If the input is <code>null</code>, an empty array is returned.
- If the input contains <code>null</code>, the output array contains <code>null</code> at the same
- index.
- <p>
- This method will decode the URL.
- Syntax such as <code>file:///my%20docs/file.txt</code> will be
- correctly decoded to <code>/my docs/file.txt</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>urls</code> - the file URLs to convert, <code>null</code> returns empty array</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a non-<code>null</code> array of Files matching the input, with a <code>null</code> item
- if there was a <code>null</code> at that index in the input array</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 any file is not a URL file</dd>
- <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 any file is incorrectly encoded</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="toURLs-java.io.File:A-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toURLs</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a>[] toURLs(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[] files)
- 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>
- <div class="block">Converts each of an array of <code>File</code> to a <code>URL</code>.
- <p>
- Returns an array of the same size as the input.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>files</code> - the files to convert, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an array of URLs matching the input</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 a file cannot be converted</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the parameter is null</dd>
- </dl>
- </li>
- </ul>
- <a name="copyFileToDirectory-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyFileToDirectory</h4>
- <pre>public static void copyFileToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Copies a file to a directory preserving the file date.
- <p>
- This method copies the contents of the specified source file
- to a file of the same name in the specified destination directory.
- The destination directory is created if it does not exist.
- If the destination file exists, then this method will overwrite it.
- <p>
- <strong>Note:</strong> This method tries to preserve the file's last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that the operation will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - an existing file to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the directory to place the copy in, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is null</dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.File-boolean-"><code>copyFile(File, File, boolean)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="copyFileToDirectory-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyFileToDirectory</h4>
- <pre>public static void copyFileToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean preserveFileDate)
- 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>
- <div class="block">Copies a file to a directory optionally preserving the file date.
- <p>
- This method copies the contents of the specified source file
- to a file of the same name in the specified destination directory.
- The destination directory is created if it does not exist.
- If the destination file exists, then this method will overwrite it.
- <p>
- <strong>Note:</strong> Setting <code>preserveFileDate</code> to
- <code>true</code> tries to preserve the file's last modified
- date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however it is
- not guaranteed that the operation will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - an existing file to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the directory to place the copy in, must not be <code>null</code></dd>
- <dd><code>preserveFileDate</code> - true if the file date of the copy
- should be the same as the original</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <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 the output file length is not the same as the input file length after the copy
- completes</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.File-boolean-"><code>copyFile(File, File, boolean)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="copyFile-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyFile</h4>
- <pre>public static void copyFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile)
- 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>
- <div class="block">Copies a file to a new location preserving the file date.
- <p>
- This method copies the contents of the specified source file to the
- specified destination file. The directory holding the destination file is
- created if it does not exist. If the destination file exists, then this
- method will overwrite it.
- <p>
- <strong>Note:</strong> This method tries to preserve the file's last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that the operation will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - an existing file to copy, must not be <code>null</code></dd>
- <dd><code>destFile</code> - the new file, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <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 the output file length is not the same as the input file length after the copy
- completes</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-"><code>copyFileToDirectory(File, File)</code></a>,
- <a href="../../../../org/apache/commons/io/FileUtils.html#copyFile-java.io.File-java.io.File-boolean-"><code>copyFile(File, File, boolean)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="copyFile-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyFile</h4>
- <pre>public static void copyFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile,
- boolean preserveFileDate)
- 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>
- <div class="block">Copies a file to a new location.
- <p>
- This method copies the contents of the specified source file
- to the specified destination file.
- The directory holding the destination file is created if it does not exist.
- If the destination file exists, then this method will overwrite it.
- <p>
- <strong>Note:</strong> Setting <code>preserveFileDate</code> to
- <code>true</code> tries to preserve the file's last modified
- date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however it is
- not guaranteed that the operation will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - an existing file to copy, must not be <code>null</code></dd>
- <dd><code>destFile</code> - the new file, must not be <code>null</code></dd>
- <dd><code>preserveFileDate</code> - true if the file date of the copy
- should be the same as the original</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <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 the output file length is not the same as the input file length after the copy
- completes</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-boolean-"><code>copyFileToDirectory(File, File, boolean)</code></a>,
- <a href="../../../../org/apache/commons/io/FileUtils.html#doCopyFile-java.io.File-java.io.File-boolean-"><code>doCopyFile(File, File, boolean)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="copyFile-java.io.File-java.io.OutputStream-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyFile</h4>
- <pre>public static long copyFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> input,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> output)
- 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>
- <div class="block">Copy bytes from a <code>File</code> to an <code>OutputStream</code>.
- <p>
- This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>.
- </p></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>input</code> - the <code>File</code> to read from</dd>
- <dd><code>output</code> - the <code>OutputStream</code> to write to</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the number of bytes copied</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the input or output is null</dd>
- <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 I/O error occurs</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="copyDirectoryToDirectory-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyDirectoryToDirectory</h4>
- <pre>public static void copyDirectoryToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Copies a directory to within another directory preserving the file dates.
- <p>
- This method copies the source directory and all its contents to a
- directory of the same name in the specified destination directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> This method tries to preserve the files' last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - an existing directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the directory to place the copy in, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.2</dd>
- </dl>
- </li>
- </ul>
- <a name="copyDirectory-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyDirectory</h4>
- <pre>public static void copyDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Copies a whole directory to a new location preserving the file dates.
- <p>
- This method copies the specified directory and all its child
- directories and files to the specified destination.
- The destination is the new location and name of the directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> This method tries to preserve the files' last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - an existing directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the new directory, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="copyDirectory-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyDirectory</h4>
- <pre>public static void copyDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean preserveFileDate)
- 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>
- <div class="block">Copies a whole directory to a new location.
- <p>
- This method copies the contents of the specified source directory
- to within the specified destination directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> Setting <code>preserveFileDate</code> to
- <code>true</code> tries to preserve the files' last modified
- date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however it is
- not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - an existing directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the new directory, must not be <code>null</code></dd>
- <dd><code>preserveFileDate</code> - true if the file date of the copy
- should be the same as the original</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="copyDirectory-java.io.File-java.io.File-java.io.FileFilter-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyDirectory</h4>
- <pre>public static void copyDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter)
- 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>
- <div class="block">Copies a filtered directory to a new location preserving the file dates.
- <p>
- This method copies the contents of the specified source directory
- to within the specified destination directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> This method tries to preserve the files' last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.
- </p>
- <h3>Example: Copy directories only</h3>
- <pre>
- // only copy the directory structure
- FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY);
- </pre>
- <h3>Example: Copy directories and txt files</h3>
- <pre>
- // Create a filter for ".txt" files
- IOFileFilter txtSuffixFilter = FileFilterUtils.suffixFileFilter(".txt");
- IOFileFilter txtFiles = FileFilterUtils.andFileFilter(FileFileFilter.FILE, txtSuffixFilter);
- // Create a filter for either directories or ".txt" files
- FileFilter filter = FileFilterUtils.orFileFilter(DirectoryFileFilter.DIRECTORY, txtFiles);
- // Copy using the filter
- FileUtils.copyDirectory(srcDir, destDir, filter);
- </pre></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - an existing directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the new directory, must not be <code>null</code></dd>
- <dd><code>filter</code> - the filter to apply, null means copy all directories and files
- should be the same as the original</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="copyDirectory-java.io.File-java.io.File-java.io.FileFilter-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyDirectory</h4>
- <pre>public static void copyDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a> filter,
- boolean preserveFileDate)
- 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>
- <div class="block">Copies a filtered directory to a new location.
- <p>
- This method copies the contents of the specified source directory
- to within the specified destination directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> Setting <code>preserveFileDate</code> to
- <code>true</code> tries to preserve the files' last modified
- date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however it is
- not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.
- </p>
- <h3>Example: Copy directories only</h3>
- <pre>
- // only copy the directory structure
- FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY, false);
- </pre>
- <h3>Example: Copy directories and txt files</h3>
- <pre>
- // Create a filter for ".txt" files
- IOFileFilter txtSuffixFilter = FileFilterUtils.suffixFileFilter(".txt");
- IOFileFilter txtFiles = FileFilterUtils.andFileFilter(FileFileFilter.FILE, txtSuffixFilter);
- // Create a filter for either directories or ".txt" files
- FileFilter filter = FileFilterUtils.orFileFilter(DirectoryFileFilter.DIRECTORY, txtFiles);
- // Copy using the filter
- FileUtils.copyDirectory(srcDir, destDir, filter, false);
- </pre></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - an existing directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the new directory, must not be <code>null</code></dd>
- <dd><code>filter</code> - the filter to apply, null means copy all directories and files</dd>
- <dd><code>preserveFileDate</code> - true if the file date of the copy
- should be the same as the original</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="copyURLToFile-java.net.URL-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyURLToFile</h4>
- <pre>public static void copyURLToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)
- 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>
- <div class="block">Copies bytes from the URL <code>source</code> to a file
- <code>destination</code>. The directories up to <code>destination</code>
- will be created if they don't already exist. <code>destination</code>
- will be overwritten if it already exists.
- <p>
- Warning: this method does not set a connection or read timeout and thus
- might block forever. Use <a href="../../../../org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-int-int-"><code>copyURLToFile(URL, File, int, int)</code></a>
- with reasonable timeouts to prevent this.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>source</code> - the <code>URL</code> to copy bytes from, must not be <code>null</code></dd>
- <dd><code>destination</code> - the non-directory <code>File</code> to write bytes to
- (possibly overwriting), must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 <code>source</code> URL cannot be opened</dd>
- <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 <code>destination</code> is a directory</dd>
- <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 <code>destination</code> cannot be written</dd>
- <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 <code>destination</code> needs creating but can't be</dd>
- <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 during copying</dd>
- </dl>
- </li>
- </ul>
- <a name="copyURLToFile-java.net.URL-java.io.File-int-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyURLToFile</h4>
- <pre>public static void copyURLToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/net/URL.html?is-external=true" title="class or interface in java.net">URL</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination,
- int connectionTimeout,
- int readTimeout)
- 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>
- <div class="block">Copies bytes from the URL <code>source</code> to a file
- <code>destination</code>. The directories up to <code>destination</code>
- will be created if they don't already exist. <code>destination</code>
- will be overwritten if it already exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>source</code> - the <code>URL</code> to copy bytes from, must not be <code>null</code></dd>
- <dd><code>destination</code> - the non-directory <code>File</code> to write bytes to
- (possibly overwriting), must not be <code>null</code></dd>
- <dd><code>connectionTimeout</code> - the number of milliseconds until this method
- will timeout if no connection could be established to the <code>source</code></dd>
- <dd><code>readTimeout</code> - the number of milliseconds until this method will
- timeout if no data could be read from the <code>source</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 <code>source</code> URL cannot be opened</dd>
- <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 <code>destination</code> is a directory</dd>
- <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 <code>destination</code> cannot be written</dd>
- <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 <code>destination</code> needs creating but can't be</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="copyInputStreamToFile-java.io.InputStream-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyInputStreamToFile</h4>
- <pre>public static void copyInputStreamToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)
- 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>
- <div class="block">Copies bytes from an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> <code>source</code> to a file
- <code>destination</code>. The directories up to <code>destination</code>
- will be created if they don't already exist. <code>destination</code>
- will be overwritten if it already exists.
- The <code>source</code> stream is closed.
- See <a href="../../../../org/apache/commons/io/FileUtils.html#copyToFile-java.io.InputStream-java.io.File-"><code>copyToFile(InputStream, File)</code></a> for a method that does not close the input stream.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>source</code> - the <code>InputStream</code> to copy bytes from, must not be <code>null</code>, will be closed</dd>
- <dd><code>destination</code> - the non-directory <code>File</code> to write bytes to
- (possibly overwriting), must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 <code>destination</code> is a directory</dd>
- <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 <code>destination</code> cannot be written</dd>
- <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 <code>destination</code> needs creating but can't be</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="copyToFile-java.io.InputStream-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyToFile</h4>
- <pre>public static void copyToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> source,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destination)
- 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>
- <div class="block">Copies bytes from an <a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> <code>source</code> to a file
- <code>destination</code>. The directories up to <code>destination</code>
- will be created if they don't already exist. <code>destination</code>
- will be overwritten if it already exists.
- The <code>source</code> stream is left open, e.g. for use with <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/ZipInputStream.html?is-external=true" title="class or interface in java.util.zip"><code>ZipInputStream</code></a>.
- See <a href="../../../../org/apache/commons/io/FileUtils.html#copyInputStreamToFile-java.io.InputStream-java.io.File-"><code>copyInputStreamToFile(InputStream, File)</code></a> for a method that closes the input stream.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>source</code> - the <code>InputStream</code> to copy bytes from, must not be <code>null</code></dd>
- <dd><code>destination</code> - the non-directory <code>File</code> to write bytes to
- (possibly overwriting), must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 <code>destination</code> is a directory</dd>
- <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 <code>destination</code> cannot be written</dd>
- <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 <code>destination</code> needs creating but can't be</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.5</dd>
- </dl>
- </li>
- </ul>
- <a name="copyToDirectory-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyToDirectory</h4>
- <pre>public static void copyToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Copies a file or directory to within another directory preserving the file dates.
- <p>
- This method copies the source file or directory, along all its contents, to a
- directory of the same name in the specified destination directory.
- <p>
- The destination directory is created if it does not exist.
- If the destination directory did exist, then this method merges
- the source with the destination, with the source taking precedence.
- <p>
- <strong>Note:</strong> This method tries to preserve the files' last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that those operations will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - an existing file or directory to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the directory to place the copy in, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.6</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyDirectoryToDirectory-java.io.File-java.io.File-"><code>copyDirectoryToDirectory(File, File)</code></a>,
- <a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-"><code>copyFileToDirectory(File, File)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="copyToDirectory-java.lang.Iterable-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>copyToDirectory</h4>
- <pre>public static void copyToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>> srcs,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Copies a files to a directory preserving each file's date.
- <p>
- This method copies the contents of the specified source files
- to a file of the same name in the specified destination directory.
- The destination directory is created if it does not exist.
- If the destination file exists, then this method will overwrite it.
- <p>
- <strong>Note:</strong> This method tries to preserve the file's last
- modified date/times using <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#setLastModified-long-" title="class or interface in java.io"><code>File.setLastModified(long)</code></a>, however
- it is not guaranteed that the operation will succeed.
- If the modification operation fails, no indication is provided.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcs</code> - a existing files to copy, must not be <code>null</code></dd>
- <dd><code>destDir</code> - the directory to place the copy in, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is null</dd>
- <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 source or destination is invalid</dd>
- <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 during copying</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.6</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#copyFileToDirectory-java.io.File-java.io.File-"><code>copyFileToDirectory(File, File)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="deleteDirectory-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>deleteDirectory</h4>
- <pre>public static void deleteDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)
- 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>
- <div class="block">Deletes a directory recursively.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - directory to delete</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case deletion is unsuccessful</dd>
- <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 <code>directory</code> does not exist or is not a directory</dd>
- </dl>
- </li>
- </ul>
- <a name="deleteQuietly-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>deleteQuietly</h4>
- <pre>public static boolean deleteQuietly(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</pre>
- <div class="block">Deletes a file, never throwing an exception. If file is a directory, delete it and all sub-directories.
- <p>
- The difference between File.delete() and this method are:
- <ul>
- <li>A directory to be deleted does not have to be empty.</li>
- <li>No exceptions are thrown when a file or directory cannot be deleted.</li>
- </ul></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - file or directory to delete, can be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd><code>true</code> if the file or directory was deleted, otherwise
- <code>false</code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="directoryContains-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>directoryContains</h4>
- <pre>public static boolean directoryContains(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> child)
- 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>
- <div class="block">Determines whether the <code>parent</code> directory contains the <code>child</code> element (a file or directory).
- <p>
- Files are normalized before comparison.
- </p>
- Edge cases:
- <ul>
- <li>A <code>directory</code> must not be null: if null, throw IllegalArgumentException</li>
- <li>A <code>directory</code> must be a directory: if not a directory, throw IllegalArgumentException</li>
- <li>A directory does not contain itself: return false</li>
- <li>A null child file is not contained in any parent: return false</li>
- </ul></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - the file to consider as the parent.</dd>
- <dd><code>child</code> - the file to consider as the child.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true is the candidate leaf is under by the specified composite. False otherwise.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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>
- <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 <code>directory</code> is null or not a directory.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.2</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FilenameUtils.html#directoryContains-java.lang.String-java.lang.String-"><code>FilenameUtils.directoryContains(String, String)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="cleanDirectory-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>cleanDirectory</h4>
- <pre>public static void cleanDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)
- 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>
- <div class="block">Cleans a directory without deleting it.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - directory to clean</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case cleaning is unsuccessful</dd>
- <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 <code>directory</code> does not exist or is not a directory</dd>
- </dl>
- </li>
- </ul>
- <a name="waitFor-java.io.File-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>waitFor</h4>
- <pre>public static boolean waitFor(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- int seconds)</pre>
- <div class="block">Waits for NFS to propagate a file creation, imposing a timeout.
- <p>
- This method repeatedly tests <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true#exists--" title="class or interface in java.io"><code>File.exists()</code></a> until it returns
- true up to the maximum time specified in seconds.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to check, must not be <code>null</code></dd>
- <dd><code>seconds</code> - the maximum time in seconds to wait</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if file exists</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="readFileToString-java.io.File-java.nio.charset.Charset-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readFileToString</h4>
- <pre>public 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> readFileToString(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)
- 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>
- <div class="block">Reads the contents of a file into a String.
- The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file contents, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="readFileToString-java.io.File-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readFileToString</h4>
- <pre>public 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> readFileToString(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)
- 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>
- <div class="block">Reads the contents of a file into a String. The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file contents, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/UnsupportedCharsetException.html?is-external=true" title="class or interface in java.nio.charset">UnsupportedCharsetException</a></code> - thrown instead of <a href="http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html?is-external=true"><code>.UnsupportedEncodingException</code></a> in version 2.2 if the encoding is not supported.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="readFileToString-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readFileToString</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public 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> readFileToString(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#readFileToString-java.io.File-java.nio.charset.Charset-"><code>readFileToString(File, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Reads the contents of a file into a String using the default encoding for the VM.
- The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file contents, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3.1</dd>
- </dl>
- </li>
- </ul>
- <a name="readFileToByteArray-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readFileToByteArray</h4>
- <pre>public static byte[] readFileToByteArray(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Reads the contents of a file into a byte array.
- The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the file contents, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="readLines-java.io.File-java.nio.charset.Charset-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readLines</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> readLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)
- 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>
- <div class="block">Reads the contents of a file line by line to a List of Strings.
- The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the list of Strings representing each line in the file, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="readLines-java.io.File-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readLines</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> readLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)
- 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>
- <div class="block">Reads the contents of a file line by line to a List of Strings. The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the list of Strings representing each line in the file, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/UnsupportedCharsetException.html?is-external=true" title="class or interface in java.nio.charset">UnsupportedCharsetException</a></code> - thrown instead of <a href="http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html?is-external=true"><code>.UnsupportedEncodingException</code></a> in version 2.2 if the encoding is not supported.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="readLines-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>readLines</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> readLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#readLines-java.io.File-java.nio.charset.Charset-"><code>readLines(File, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Reads the contents of a file line by line to a List of Strings using the default encoding for the VM.
- The file is always closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to read, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the list of Strings representing each line in the file, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="lineIterator-java.io.File-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>lineIterator</h4>
- <pre>public static <a href="../../../../org/apache/commons/io/LineIterator.html" title="class in org.apache.commons.io">LineIterator</a> lineIterator(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding)
- 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>
- <div class="block">Returns an Iterator for the lines in a <code>File</code>.
- <p>
- This method opens an <code>InputStream</code> for the file.
- When you have finished with the iterator you should close the stream
- to free internal resources. This can be done by calling the
- <a href="../../../../org/apache/commons/io/LineIterator.html#close--"><code>LineIterator.close()</code></a> or
- <a href="../../../../org/apache/commons/io/LineIterator.html#closeQuietly-org.apache.commons.io.LineIterator-"><code>LineIterator.closeQuietly(LineIterator)</code></a> method.
- <p>
- The recommended usage pattern is:
- <pre>
- LineIterator it = FileUtils.lineIterator(file, "UTF-8");
- try {
- while (it.hasNext()) {
- String line = it.nextLine();
- /// do something with line
- }
- } finally {
- LineIterator.closeQuietly(iterator);
- }
- </pre>
- <p>
- If an exception occurs during the creation of the iterator, the
- underlying stream is closed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to open for input, must not be <code>null</code></dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an Iterator of the lines in the file, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error (file closed)</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.2</dd>
- </dl>
- </li>
- </ul>
- <a name="lineIterator-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>lineIterator</h4>
- <pre>public static <a href="../../../../org/apache/commons/io/LineIterator.html" title="class in org.apache.commons.io">LineIterator</a> lineIterator(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Returns an Iterator for the lines in a <code>File</code> using the default encoding for the VM.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to open for input, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an Iterator of the lines in the file, never <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error (file closed)</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- <dt><span class="seeLabel">See Also:</span></dt>
- <dd><a href="../../../../org/apache/commons/io/FileUtils.html#lineIterator-java.io.File-java.lang.String-"><code>lineIterator(File, String)</code></a></dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre>public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)
- 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>
- <div class="block">Writes a String to a file creating the file if it does not exist.
- <p>
- NOTE: As from v1.3, the parent directories of the file will be created
- if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre>public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <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> encoding)
- 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>
- <div class="block">Writes a String to a file creating the file if it does not exist.
- <p>
- NOTE: As from v1.3, the parent directories of the file will be created
- if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre>public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding,
- boolean append)
- 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>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>append</code> - if <code>true</code>, then the String will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre>public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- <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> encoding,
- boolean append)
- 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>
- <div class="block">Writes a String to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>append</code> - if <code>true</code>, then the String will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/UnsupportedCharsetException.html?is-external=true" title="class or interface in java.nio.charset">UnsupportedCharsetException</a></code> - thrown instead of <a href="http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html?is-external=true"><code>.UnsupportedEncodingException</code></a> in version 2.2 if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-"><code>writeStringToFile(File, String, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Writes a String to a file creating the file if it does not exist using the default encoding for the VM.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- </dl>
- </li>
- </ul>
- <a name="writeStringToFile-java.io.File-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeStringToFile</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public static void writeStringToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> data,
- boolean append)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#writeStringToFile-java.io.File-java.lang.String-java.nio.charset.Charset-boolean-"><code>writeStringToFile(File, String, Charset, boolean)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Writes a String to a file creating the file if it does not exist using the default encoding for the VM.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>append</code> - if <code>true</code>, then the String will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-"><code>write(File, CharSequence, Charset)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist using the default encoding for the VM.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
- public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- boolean append)
- 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>
- <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">2.5 use <a href="../../../../org/apache/commons/io/FileUtils.html#write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-boolean-"><code>write(File, CharSequence, Charset, boolean)</code></a> instead (and specify the appropriate encoding)</span></div>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist using the default encoding for the VM.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>append</code> - if <code>true</code>, then the data will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre>public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding)
- 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>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre>public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <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> encoding)
- 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>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-java.nio.charset.Charset-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre>public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a> encoding,
- boolean append)
- 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>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>append</code> - if <code>true</code>, then the data will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.3</dd>
- </dl>
- </li>
- </ul>
- <a name="write-java.io.File-java.lang.CharSequence-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>write</h4>
- <pre>public static void write(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a> data,
- <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> encoding,
- boolean append)
- 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>
- <div class="block">Writes a CharSequence to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>append</code> - if <code>true</code>, then the data will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/UnsupportedCharsetException.html?is-external=true" title="class or interface in java.nio.charset">UnsupportedCharsetException</a></code> - thrown instead of <a href="http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html?is-external=true"><code>.UnsupportedEncodingException</code></a> in version 2.2 if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeByteArrayToFile-java.io.File-byte:A-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeByteArrayToFile</h4>
- <pre>public static void writeByteArrayToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data)
- 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>
- <div class="block">Writes a byte array to a file creating the file if it does not exist.
- <p>
- NOTE: As from v1.3, the parent directories of the file will be created
- if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeByteArrayToFile-java.io.File-byte:A-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeByteArrayToFile</h4>
- <pre>public static void writeByteArrayToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- boolean append)
- 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>
- <div class="block">Writes a byte array to a file creating the file if it does not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>append</code> - if <code>true</code>, then bytes will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeByteArrayToFile-java.io.File-byte:A-int-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeByteArrayToFile</h4>
- <pre>public static void writeByteArrayToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- int off,
- int len)
- 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>
- <div class="block">Writes <code>len</code> bytes from the specified byte array starting
- at offset <code>off</code> to a file, creating the file if it does
- not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>off</code> - the start offset in the data</dd>
- <dd><code>len</code> - the number of bytes to write</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.5</dd>
- </dl>
- </li>
- </ul>
- <a name="writeByteArrayToFile-java.io.File-byte:A-int-int-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeByteArrayToFile</h4>
- <pre>public static void writeByteArrayToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- byte[] data,
- int off,
- int len,
- boolean append)
- 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>
- <div class="block">Writes <code>len</code> bytes from the specified byte array starting
- at offset <code>off</code> to a file, creating the file if it does
- not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>data</code> - the content to write to the file</dd>
- <dd><code>off</code> - the start offset in the data</dd>
- <dd><code>len</code> - the number of bytes to write</dd>
- <dd><code>append</code> - if <code>true</code>, then bytes will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.5</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.lang.String-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The specified character encoding and the default line ending will be used.
- <p>
- NOTE: As from v1.3, the parent directories of the file will be created
- if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.lang.String-java.util.Collection-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- boolean append)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line, optionally appending.
- The specified character encoding and the default line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>append</code> - if <code>true</code>, then the lines will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.util.Collection-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The default VM encoding and the default line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.util.Collection-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- boolean append)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The default VM encoding and the default line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>append</code> - if <code>true</code>, then the lines will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.lang.String-java.util.Collection-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- <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> lineEnding)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The specified character encoding and the line ending will be used.
- <p>
- NOTE: As from v1.3, the parent directories of the file will be created
- if they do not exist.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>lineEnding</code> - the line separator to use, <code>null</code> is system default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.lang.String-java.util.Collection-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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> encoding,
- <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><?> lines,
- <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> lineEnding,
- boolean append)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The specified character encoding and the line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>encoding</code> - the encoding to use, <code>null</code> means platform default</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>lineEnding</code> - the line separator to use, <code>null</code> is system default</dd>
- <dd><code>append</code> - if <code>true</code>, then the lines will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</a></code> - if the encoding is not supported by the VM</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.util.Collection-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- <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> lineEnding)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The default VM encoding and the specified line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>lineEnding</code> - the line separator to use, <code>null</code> is system default</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="writeLines-java.io.File-java.util.Collection-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>writeLines</h4>
- <pre>public static void writeLines(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <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><?> lines,
- <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> lineEnding,
- boolean append)
- 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>
- <div class="block">Writes the <code>toString()</code> value of each item in a collection to
- the specified <code>File</code> line by line.
- The default VM encoding and the specified line ending will be used.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to write to</dd>
- <dd><code>lines</code> - the lines to write, <code>null</code> entries produce blank lines</dd>
- <dd><code>lineEnding</code> - the line separator to use, <code>null</code> is system default</dd>
- <dd><code>append</code> - if <code>true</code>, then the lines will be added to the
- end of the file rather than overwriting</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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> - in case of an I/O error</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.1</dd>
- </dl>
- </li>
- </ul>
- <a name="forceDelete-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>forceDelete</h4>
- <pre>public static void forceDelete(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Deletes a file. If file is a directory, delete it and all sub-directories.
- <p>
- The difference between File.delete() and this method are:
- <ul>
- <li>A directory to be deleted does not have to be empty.</li>
- <li>You get exceptions when a file or directory cannot be deleted.
- (java.io.File methods returns a boolean)</li>
- </ul></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - file or directory to delete, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the directory is <code>null</code></dd>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileNotFoundException.html?is-external=true" title="class or interface in java.io">FileNotFoundException</a></code> - if the file was not found</dd>
- <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> - in case deletion is unsuccessful</dd>
- </dl>
- </li>
- </ul>
- <a name="forceDeleteOnExit-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>forceDeleteOnExit</h4>
- <pre>public static void forceDeleteOnExit(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Schedules a file to be deleted when JVM exits.
- If file is directory delete it and all sub-directories.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - file or directory to delete, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file is <code>null</code></dd>
- <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> - in case deletion is unsuccessful</dd>
- </dl>
- </li>
- </ul>
- <a name="forceMkdir-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>forceMkdir</h4>
- <pre>public static void forceMkdir(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)
- 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>
- <div class="block">Makes a directory, including any necessary but nonexistent parent
- directories. If a file already exists with specified name but it is
- not a directory then an IOException is thrown.
- If the directory cannot be created (or does not already exist)
- then an IOException is thrown.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - directory to create, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the directory is <code>null</code></dd>
- <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 the directory cannot be created or the file already exists but is not a directory</dd>
- </dl>
- </li>
- </ul>
- <a name="forceMkdirParent-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>forceMkdirParent</h4>
- <pre>public static void forceMkdirParent(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Makes any necessary but nonexistent parent directories for a given File. If the parent directory cannot be
- created then an IOException is thrown.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - file with parent to create, must not be <code>null</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file is <code>null</code></dd>
- <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 the parent directory cannot be created</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.5</dd>
- </dl>
- </li>
- </ul>
- <a name="sizeOf-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>sizeOf</h4>
- <pre>public static long sizeOf(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</pre>
- <div class="block">Returns the size of the specified file or directory. If the provided
- <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> is a regular file, then the file's length is returned.
- If the argument is a directory, then the size of the directory is
- calculated recursively. If a directory or subdirectory is security
- restricted, its size will not be included.
- <p>
- Note that overflow is not detected, and the return value may be negative if
- overflow occurs. See <a href="../../../../org/apache/commons/io/FileUtils.html#sizeOfAsBigInteger-java.io.File-"><code>sizeOfAsBigInteger(File)</code></a> for an alternative
- method that does not overflow.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the regular file or directory to return the size
- of (must not be <code>null</code>).</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the length of the file, or recursive size of the directory,
- provided (in bytes).</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file is <code>null</code></dd>
- <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 file does not exist.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- <a name="sizeOfAsBigInteger-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>sizeOfAsBigInteger</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> sizeOfAsBigInteger(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</pre>
- <div class="block">Returns the size of the specified file or directory. If the provided
- <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> is a regular file, then the file's length is returned.
- If the argument is a directory, then the size of the directory is
- calculated recursively. If a directory or subdirectory is security
- restricted, its size will not be included.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the regular file or directory to return the size
- of (must not be <code>null</code>).</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the length of the file, or recursive size of the directory,
- provided (in bytes).</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file is <code>null</code></dd>
- <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 file does not exist.</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="sizeOfDirectory-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>sizeOfDirectory</h4>
- <pre>public static long sizeOfDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</pre>
- <div class="block">Counts the size of a directory recursively (sum of the length of all files).
- <p>
- Note that overflow is not detected, and the return value may be negative if
- overflow occurs. See <a href="../../../../org/apache/commons/io/FileUtils.html#sizeOfDirectoryAsBigInteger-java.io.File-"><code>sizeOfDirectoryAsBigInteger(File)</code></a> for an alternative
- method that does not overflow.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - directory to inspect, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>size of directory in bytes, 0 if directory is security restricted, a negative number when the real total
- is greater than <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html?is-external=true#MAX_VALUE" title="class or interface in java.lang"><code>Long.MAX_VALUE</code></a>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the directory is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="sizeOfDirectoryAsBigInteger-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>sizeOfDirectoryAsBigInteger</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a> sizeOfDirectoryAsBigInteger(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</pre>
- <div class="block">Counts the size of a directory recursively (sum of the length of all files).</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>directory</code> - directory to inspect, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>size of directory in bytes, 0 if directory is security restricted.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the directory is <code>null</code></dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.4</dd>
- </dl>
- </li>
- </ul>
- <a name="isFileNewer-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileNewer</h4>
- <pre>public static boolean isFileNewer(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> reference)</pre>
- <div class="block">Tests if the specified <code>File</code> is newer than the reference
- <code>File</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date must
- be compared, must not be <code>null</code></dd>
- <dd><code>reference</code> - the <code>File</code> of which the modification date
- is used, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified more
- recently than the reference <code>File</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- <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 reference file is <code>null</code> or doesn't exist</dd>
- </dl>
- </li>
- </ul>
- <a name="isFileNewer-java.io.File-java.util.Date-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileNewer</h4>
- <pre>public static boolean isFileNewer(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a> date)</pre>
- <div class="block">Tests if the specified <code>File</code> is newer than the specified
- <code>Date</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date
- must be compared, must not be <code>null</code></dd>
- <dd><code>date</code> - the date reference, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified
- after the given <code>Date</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- <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 date is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="isFileNewer-java.io.File-long-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileNewer</h4>
- <pre>public static boolean isFileNewer(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- long timeMillis)</pre>
- <div class="block">Tests if the specified <code>File</code> is newer than the specified
- time reference.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date must
- be compared, must not be <code>null</code></dd>
- <dd><code>timeMillis</code> - the time reference measured in milliseconds since the
- epoch (00:00:00 GMT, January 1, 1970)</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified after
- the given time reference.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="isFileOlder-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileOlder</h4>
- <pre>public static boolean isFileOlder(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> reference)</pre>
- <div class="block">Tests if the specified <code>File</code> is older than the reference
- <code>File</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date must
- be compared, must not be <code>null</code></dd>
- <dd><code>reference</code> - the <code>File</code> of which the modification date
- is used, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified before
- the reference <code>File</code></dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- <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 reference file is <code>null</code> or doesn't exist</dd>
- </dl>
- </li>
- </ul>
- <a name="isFileOlder-java.io.File-java.util.Date-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileOlder</h4>
- <pre>public static boolean isFileOlder(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a> date)</pre>
- <div class="block">Tests if the specified <code>File</code> is older than the specified
- <code>Date</code>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date
- must be compared, must not be <code>null</code></dd>
- <dd><code>date</code> - the date reference, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified
- before the given <code>Date</code>.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- <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 date is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="isFileOlder-java.io.File-long-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isFileOlder</h4>
- <pre>public static boolean isFileOlder(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- long timeMillis)</pre>
- <div class="block">Tests if the specified <code>File</code> is older than the specified
- time reference.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the <code>File</code> of which the modification date must
- be compared, must not be <code>null</code></dd>
- <dd><code>timeMillis</code> - the time reference measured in milliseconds since the
- epoch (00:00:00 GMT, January 1, 1970)</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the <code>File</code> exists and has been modified before
- the given time reference.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file is <code>null</code></dd>
- </dl>
- </li>
- </ul>
- <a name="checksumCRC32-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>checksumCRC32</h4>
- <pre>public static long checksumCRC32(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Computes the checksum of a file using the CRC32 checksum routine.
- The value of the checksum is returned.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to checksum, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the checksum value</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file or checksum is <code>null</code></dd>
- <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 file is a directory</dd>
- <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 reading the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="checksum-java.io.File-java.util.zip.Checksum-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>checksum</h4>
- <pre>public static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Checksum.html?is-external=true" title="class or interface in java.util.zip">Checksum</a> checksum(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/util/zip/Checksum.html?is-external=true" title="class or interface in java.util.zip">Checksum</a> checksum)
- 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>
- <div class="block">Computes the checksum of a file using the specified checksum object.
- Multiple files may be checked using one <code>Checksum</code> instance
- if desired simply by reusing the same checksum object.
- For example:
- <pre>
- long csum = FileUtils.checksum(file, new CRC32()).getValue();
- </pre></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to checksum, must not be <code>null</code></dd>
- <dd><code>checksum</code> - the checksum object to be used, must not be <code>null</code></dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the checksum specified, updated with the content of the file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the file or checksum is <code>null</code></dd>
- <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 file is a directory</dd>
- <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 reading the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.3</dd>
- </dl>
- </li>
- </ul>
- <a name="moveDirectory-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>moveDirectory</h4>
- <pre>public static void moveDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcDir,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir)
- 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>
- <div class="block">Moves a directory.
- <p>
- When the destination directory is on another file system, do a "copy and delete".</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcDir</code> - the directory to be moved</dd>
- <dd><code>destDir</code> - the destination directory</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <dd><code><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io">FileExistsException</a></code> - if the destination directory exists</dd>
- <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 source or destination is invalid</dd>
- <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 moving the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="moveDirectoryToDirectory-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>moveDirectoryToDirectory</h4>
- <pre>public static void moveDirectoryToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)
- 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>
- <div class="block">Moves a directory to another directory.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the file to be moved</dd>
- <dd><code>destDir</code> - the destination file</dd>
- <dd><code>createDestDir</code> - If <code>true</code> create the destination directory,
- otherwise if <code>false</code> throw an IOException</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <dd><code><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io">FileExistsException</a></code> - if the directory exists in the destination directory</dd>
- <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 source or destination is invalid</dd>
- <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 moving the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="moveFile-java.io.File-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>moveFile</h4>
- <pre>public static void moveFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destFile)
- 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>
- <div class="block">Moves a file.
- <p>
- When the destination file is on another file system, do a "copy and delete".</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - the file to be moved</dd>
- <dd><code>destFile</code> - the destination file</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <dd><code><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io">FileExistsException</a></code> - if the destination file exists</dd>
- <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 source or destination is invalid</dd>
- <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 moving the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="moveFileToDirectory-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>moveFileToDirectory</h4>
- <pre>public static void moveFileToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> srcFile,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)
- 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>
- <div class="block">Moves a file to a directory.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>srcFile</code> - the file to be moved</dd>
- <dd><code>destDir</code> - the destination file</dd>
- <dd><code>createDestDir</code> - If <code>true</code> create the destination directory,
- otherwise if <code>false</code> throw an IOException</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <dd><code><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io">FileExistsException</a></code> - if the destination file exists</dd>
- <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 source or destination is invalid</dd>
- <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 moving the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="moveToDirectory-java.io.File-java.io.File-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>moveToDirectory</h4>
- <pre>public static void moveToDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> src,
- <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> destDir,
- boolean createDestDir)
- 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>
- <div class="block">Moves a file or directory to the destination directory.
- <p>
- When the destination is on another file system, do a "copy and delete".</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>src</code> - the file or directory to be moved</dd>
- <dd><code>destDir</code> - the destination directory</dd>
- <dd><code>createDestDir</code> - If <code>true</code> create the destination directory,
- otherwise if <code>false</code> throw an IOException</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if source or destination is <code>null</code></dd>
- <dd><code><a href="../../../../org/apache/commons/io/FileExistsException.html" title="class in org.apache.commons.io">FileExistsException</a></code> - if the directory or file exists in the destination directory</dd>
- <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 source or destination is invalid</dd>
- <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 moving the file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>1.4</dd>
- </dl>
- </li>
- </ul>
- <a name="isSymlink-java.io.File-">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>isSymlink</h4>
- <pre>public static boolean isSymlink(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)
- 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>
- <div class="block">Determines whether the specified file is a Symbolic Link rather than an actual file.
- <p>
- Will not return true if there is a Symbolic Link anywhere in the path,
- only if the specific file is.
- <p>
- When using jdk1.7, this method delegates to <code>boolean java.nio.file.Files.isSymbolicLink(Path path)</code>
- <b>Note:</b> the current implementation always returns <code>false</code> if running on
- jkd1.6 and the system is detected as Windows using <a href="../../../../org/apache/commons/io/FilenameUtils.html#isSystemWindows--"><code>FilenameUtils.isSystemWindows()</code></a>
- <p>
- For code that runs on Java 1.7 or later, use the following method instead:
- <br>
- <code>boolean java.nio.file.Files.isSymbolicLink(Path path)</code></div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>file</code> - the file to check</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the file is a Symbolic Link</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <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 file</dd>
- <dt><span class="simpleTagLabel">Since:</span></dt>
- <dd>2.0</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </div>
- </div>
- <!-- ========= END OF CLASS DATA ========= -->
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <div class="bottomNav"><a name="navbar.bottom">
- <!-- -->
- </a>
- <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
- <a name="navbar.bottom.firstrow">
- <!-- -->
- </a>
- <ul class="navList" title="Navigation">
- <li><a href="../../../../overview-summary.html">Overview</a></li>
- <li><a href="package-summary.html">Package</a></li>
- <li class="navBarCell1Rev">Class</li>
- <li><a href="class-use/FileUtils.html">Use</a></li>
- <li><a href="package-tree.html">Tree</a></li>
- <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
- <li><a href="../../../../index-all.html">Index</a></li>
- <li><a href="../../../../help-doc.html">Help</a></li>
- </ul>
- </div>
- <div class="subNav">
- <ul class="navList">
- <li><a href="../../../../org/apache/commons/io/FileSystemUtils.html" title="class in org.apache.commons.io"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../../../../org/apache/commons/io/HexDump.html" title="class in org.apache.commons.io"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../../../../index.html?org/apache/commons/io/FileUtils.html" target="_top">Frames</a></li>
- <li><a href="FileUtils.html" target="_top">No Frames</a></li>
- </ul>
- <ul class="navList" id="allclasses_navbar_bottom">
- <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
- </ul>
- <div>
- <script type="text/javascript"><!--
- allClassesLink = document.getElementById("allclasses_navbar_bottom");
- if(window==top) {
- allClassesLink.style.display = "block";
- }
- else {
- allClassesLink.style.display = "none";
- }
- //-->
- </script>
- </div>
- <div>
- <ul class="subNavList">
- <li>Summary: </li>
- <li>Nested | </li>
- <li><a href="#field.summary">Field</a> | </li>
- <li><a href="#constructor.summary">Constr</a> | </li>
- <li><a href="#method.summary">Method</a></li>
- </ul>
- <ul class="subNavList">
- <li>Detail: </li>
- <li><a href="#field.detail">Field</a> | </li>
- <li><a href="#constructor.detail">Constr</a> | </li>
- <li><a href="#method.detail">Method</a></li>
- </ul>
- </div>
- <a name="skip.navbar.bottom">
- <!-- -->
- </a></div>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <p class="legalCopy"><small>Copyright © 2002–2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
- </body>
- </html>
|