blob: 21d0dcbd12d683a6f8ba9bcd1f3dab4d530d5581 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:01:44 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FileUtil (Apache Hadoop Common 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<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="FileUtil (Apache Hadoop Common 3.3.1 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":41,"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};
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/FileUtil.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/hadoop/fs/FileSystem.Statistics.StatisticsData.html" title="class in org.apache.hadoop.fs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/fs/FileUtil.HardLink.html" title="class in org.apache.hadoop.fs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/fs/FileUtil.html" target="_top">Frames</a></li>
<li><a href="FileUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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.hadoop.fs</div>
<h2 title="Class FileUtil" class="title">Class FileUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/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.hadoop.fs.FileUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Evolving
public class <span class="typeNameLabel">FileUtil</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">A collection of file-processing util methods</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.HardLink.html" title="class in org.apache.hadoop.fs">FileUtil.HardLink</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/fs/HardLink.html" title="class in org.apache.hadoop.fs"><code>HardLink</code></a></span></div>
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== 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">&nbsp;</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 int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#SYMLINK_NO_PRIVILEGE">SYMLINK_NO_PRIVILEGE</a></span></code>&nbsp;</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">&nbsp;</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/hadoop/fs/FileUtil.html#FileUtil--">FileUtil</a></span>()</code>&nbsp;</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">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</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 boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#canExecute-java.io.File-">canExecute</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canExecute--" title="class or interface in java.io"><code>File.canExecute()</code></a></div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#canRead-java.io.File-">canRead</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canRead--" title="class or interface in java.io"><code>File.canRead()</code></a></div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#canWrite-java.io.File-">canWrite</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canWrite--" title="class or interface in java.io"><code>File.canWrite()</code></a></div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#chmod-java.lang.String-java.lang.String-">chmod</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;perm)</code>
<div class="block">Change the permissions on a filename.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#chmod-java.lang.String-java.lang.String-boolean-">chmod</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;perm,
boolean&nbsp;recursive)</code>
<div class="block">Change the permissions on a file / directory, recursively, if
needed.</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/hadoop/fs/FileUtil.html#compareFs-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.FileSystem-">compareFs</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFs,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;destFs)</code>&nbsp;</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/hadoop/fs/FileUtil.html#copy-java.io.File-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>
<div class="block">Copy local files to a FileSystem.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.FileStatus-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>&nbsp;srcStatus,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>
<div class="block">Copy files between FileSystems.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path:A-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]&nbsp;srcs,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.io.File-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>
<div class="block">Copy FileSystem files to local files.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>
<div class="block">Copy files between FileSystems.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-org.apache.hadoop.conf.Configuration-">copy</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)</code>
<div class="block">Copy files between FileSystems.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#createJarWithClassPath-java.lang.String-org.apache.hadoop.fs.Path-java.util.Map-">createJarWithClassPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;inputClassPath,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;pwd,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;callerEnv)</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#createJarWithClassPath-java.lang.String-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Path-java.util.Map-">createJarWithClassPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;inputClassPath,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;pwd,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;targetDir,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;callerEnv)</code>
<div class="block">Create a jar file at the given path, containing a manifest with a classpath
that references all specified entries.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#createLocalTempFile-java.io.File-java.lang.String-boolean-">createLocalTempFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;basefile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;prefix,
boolean&nbsp;isDeleteOnExit)</code>
<div class="block">Create a tmp file for a base file.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#fullyDelete-java.io.File-">fullyDelete</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</code>
<div class="block">Delete a directory and all its contents.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#fullyDelete-java.io.File-boolean-">fullyDelete</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir,
boolean&nbsp;tryGrantPermissions)</code>
<div class="block">Delete a directory and all its contents.</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/hadoop/fs/FileUtil.html#fullyDelete-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-">fullyDelete</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dir)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/fs/FileSystem.html#delete-org.apache.hadoop.fs.Path-boolean-"><code>FileSystem.delete(Path, boolean)</code></a></span></div>
</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#fullyDeleteContents-java.io.File-">fullyDeleteContents</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</code>
<div class="block">Delete the contents of a directory, not the directory itself.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#fullyDeleteContents-java.io.File-boolean-">fullyDeleteContents</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir,
boolean&nbsp;tryGrantPermissions)</code>
<div class="block">Delete the contents of a directory, not the directory itself.</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/hadoop/fs/FileUtil.html#fullyDeleteOnExit-java.io.File-">fullyDeleteOnExit</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</code>
<div class="block">Register all files recursively to be deleted on exit.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#getDU-java.io.File-">getDU</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</code>
<div class="block">Takes an input dir and returns the du on that local directory.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#getJarsInDirectory-java.lang.String-">getJarsInDirectory</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path)</code>
<div class="block">Returns all jars that are in the directory.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#getJarsInDirectory-java.lang.String-boolean-">getJarsInDirectory</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path,
boolean&nbsp;useLocal)</code>
<div class="block">Returns all jars that are in the directory.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#list-java.io.File-">list</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</code>
<div class="block">A wrapper for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#list--" title="class or interface in java.io"><code>File.list()</code></a>.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#listFiles-java.io.File-">listFiles</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</code>
<div class="block">A wrapper for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#listFiles--" title="class or interface in java.io"><code>File.listFiles()</code></a>.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#makeSecureShellPath-java.io.File-">makeSecureShellPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</code>
<div class="block">Convert a os-native filename to a path that works for the shell
and avoids script injection attacks.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#makeShellPath-java.io.File-">makeShellPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</code>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#makeShellPath-java.io.File-boolean-">makeShellPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
boolean&nbsp;makeCanonicalPath)</code>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#makeShellPath-java.lang.String-">makeShellPath</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)</code>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/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/hadoop/fs/FileUtil.html#readLink-java.io.File-">readLink</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>
<div class="block">Returns the target of the given symlink.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#replaceFile-java.io.File-java.io.File-">replaceFile</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;src,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;target)</code>
<div class="block">Move the src file to the name specified by target.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#setExecutable-java.io.File-boolean-">setExecutable</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;executable)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setExecutable-boolean-" title="class or interface in java.io"><code>File.setExecutable(boolean)</code></a>
File#setExecutable does not work as expected on Windows.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#setOwner-java.io.File-java.lang.String-java.lang.String-">setOwner</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;username,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;groupname)</code>
<div class="block">Set the ownership on a file / directory.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#setPermission-java.io.File-org.apache.hadoop.fs.permission.FsPermission-">setPermission</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
<a href="../../../../org/apache/hadoop/fs/permission/FsPermission.html" title="class in org.apache.hadoop.fs.permission">FsPermission</a>&nbsp;permission)</code>
<div class="block">Set permissions to the required value.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#setReadable-java.io.File-boolean-">setReadable</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;readable)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setReadable-boolean-" title="class or interface in java.io"><code>File.setReadable(boolean)</code></a>
File#setReadable does not work as expected on Windows.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#setWritable-java.io.File-boolean-">setWritable</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;writable)</code>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setWritable-boolean-" title="class or interface in java.io"><code>File.setWritable(boolean)</code></a>
File#setWritable does not work as expected on Windows.</div>
</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#stat2Paths-org.apache.hadoop.fs.FileStatus:A-">stat2Paths</a></span>(<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>[]&nbsp;stats)</code>
<div class="block">convert an array of FileStatus to an array of Path</div>
</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#stat2Paths-org.apache.hadoop.fs.FileStatus:A-org.apache.hadoop.fs.Path-">stat2Paths</a></span>(<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>[]&nbsp;stats,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path)</code>
<div class="block">convert an array of FileStatus to an array of Path.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#symLink-java.lang.String-java.lang.String-">symLink</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;target,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;linkname)</code>
<div class="block">Create a soft link between a src and destination
only on a local disk.</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#unTar-java.io.File-java.io.File-">unTar</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inFile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;untarDir)</code>
<div class="block">Given a Tar File as input it will untar the file in a the untar directory
passed as the second parameter
This utility will untar ".tar" files and ".tar.gz","tgz" files.</div>
</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#unTar-java.io.InputStream-java.io.File-boolean-">unTar</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputStream,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;untarDir,
boolean&nbsp;gzipped)</code>
<div class="block">Given a Tar File as input it will untar the file in a the untar directory
passed as the second parameter
This utility will untar ".tar" files and ".tar.gz","tgz" files.</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#unZip-java.io.File-java.io.File-">unZip</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inFile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;unzipDir)</code>
<div class="block">Given a File input it will unzip it in the unzip directory.</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#unZip-java.io.InputStream-java.io.File-">unZip</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputStream,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;toDir)</code>
<div class="block">Given a stream input it will unzip the it in the unzip directory.</div>
</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-byte:A-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
byte[]&nbsp;bytes)</code>
<div class="block">Writes bytes to a file.</div>
</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.CharSequence-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq)</code>
<div class="block">Write a line of text to a file.</div>
</td>
</tr>
<tr id="i46" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.CharSequence-java.nio.charset.Charset-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)</code>
<div class="block">Write a line of text to a file.</div>
</td>
</tr>
<tr id="i47" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.Iterable-java.nio.charset.Charset-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&gt;&nbsp;lines,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)</code>
<div class="block">Write lines of text to a file.</div>
</td>
</tr>
<tr id="i48" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-byte:A-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
byte[]&nbsp;bytes)</code>
<div class="block">Writes bytes to a file.</div>
</td>
</tr>
<tr id="i49" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.CharSequence-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq)</code>
<div class="block">Write a line of text to a file.</div>
</td>
</tr>
<tr id="i50" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.CharSequence-java.nio.charset.Charset-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)</code>
<div class="block">Write a line of text to a file.</div>
</td>
</tr>
<tr id="i51" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/fs/FileUtil.html#write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.Iterable-java.nio.charset.Charset-">write</a></span>(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&gt;&nbsp;lines,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)</code>
<div class="block">Write lines of text to a file.</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&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/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="SYMLINK_NO_PRIVILEGE">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SYMLINK_NO_PRIVILEGE</h4>
<pre>public static final&nbsp;int SYMLINK_NO_PRIVILEGE</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.apache.hadoop.fs.FileUtil.SYMLINK_NO_PRIVILEGE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="FileUtil--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>FileUtil</h4>
<pre>public&nbsp;FileUtil()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="stat2Paths-org.apache.hadoop.fs.FileStatus:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stat2Paths</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]&nbsp;stat2Paths(<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>[]&nbsp;stats)</pre>
<div class="block">convert an array of FileStatus to an array of Path</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stats</code> - an array of FileStatus objects</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of paths corresponding to the input</dd>
</dl>
</li>
</ul>
<a name="stat2Paths-org.apache.hadoop.fs.FileStatus:A-org.apache.hadoop.fs.Path-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stat2Paths</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]&nbsp;stat2Paths(<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>[]&nbsp;stats,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path)</pre>
<div class="block">convert an array of FileStatus to an array of Path.
If stats if null, return path</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stats</code> - an array of FileStatus objects</dd>
<dd><code>path</code> - default path to return in stats is null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of paths corresponding to the input</dd>
</dl>
</li>
</ul>
<a name="fullyDeleteOnExit-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDeleteOnExit</h4>
<pre>public static&nbsp;void&nbsp;fullyDeleteOnExit(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</pre>
<div class="block">Register all files recursively to be deleted on exit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - File/directory to be deleted</dd>
</dl>
</li>
</ul>
<a name="fullyDelete-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDelete</h4>
<pre>public static&nbsp;boolean&nbsp;fullyDelete(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</pre>
<div class="block">Delete a directory and all its contents. If
we return false, the directory may be partially-deleted.
(1) If dir is symlink to a file, the symlink is deleted. The file pointed
to by the symlink is not deleted.
(2) If dir is symlink to a directory, symlink is deleted. The directory
pointed to by symlink is not deleted.
(3) If dir is a normal file, it is deleted.
(4) If dir is a normal directory, then dir and all its contents recursively
are deleted.</div>
</li>
</ul>
<a name="fullyDelete-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDelete</h4>
<pre>public static&nbsp;boolean&nbsp;fullyDelete(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir,
boolean&nbsp;tryGrantPermissions)</pre>
<div class="block">Delete a directory and all its contents. If
we return false, the directory may be partially-deleted.
(1) If dir is symlink to a file, the symlink is deleted. The file pointed
to by the symlink is not deleted.
(2) If dir is symlink to a directory, symlink is deleted. The directory
pointed to by symlink is not deleted.
(3) If dir is a normal file, it is deleted.
(4) If dir is a normal directory, then dir and all its contents recursively
are deleted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dir</code> - the file or directory to be deleted</dd>
<dd><code>tryGrantPermissions</code> - true if permissions should be modified to delete a file.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true on success false on failure.</dd>
</dl>
</li>
</ul>
<a name="readLink-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readLink</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;readLink(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
<div class="block">Returns the target of the given symlink. Returns the empty string if
the given path does not refer to a symlink or there is an error
accessing the symlink.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - File representing the symbolic link.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The target of the symbolic link, empty string on error or if not
a symlink.</dd>
</dl>
</li>
</ul>
<a name="fullyDeleteContents-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDeleteContents</h4>
<pre>public static&nbsp;boolean&nbsp;fullyDeleteContents(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</pre>
<div class="block">Delete the contents of a directory, not the directory itself. If
we return false, the directory may be partially-deleted.
If dir is a symlink to a directory, all the contents of the actual
directory pointed to by dir will be deleted.</div>
</li>
</ul>
<a name="fullyDeleteContents-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDeleteContents</h4>
<pre>public static&nbsp;boolean&nbsp;fullyDeleteContents(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir,
boolean&nbsp;tryGrantPermissions)</pre>
<div class="block">Delete the contents of a directory, not the directory itself. If
we return false, the directory may be partially-deleted.
If dir is a symlink to a directory, all the contents of the actual
directory pointed to by dir will be deleted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tryGrantPermissions</code> - if 'true', try grant +rwx permissions to this
and all the underlying directories before trying to delete their contents.</dd>
</dl>
</li>
</ul>
<a name="fullyDelete-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fullyDelete</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public static&nbsp;void&nbsp;fullyDelete(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dir)
throws <a href="https://docs.oracle.com/javase/8/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>&nbsp;<span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/fs/FileSystem.html#delete-org.apache.hadoop.fs.Path-boolean-"><code>FileSystem.delete(Path, boolean)</code></a></span></div>
<div class="block">Recursively delete a directory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fs</code> - <a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs"><code>FileSystem</code></a> on which the path is present</dd>
<dd><code>dir</code> - directory to recursively delete</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Copy files between FileSystems.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path:A-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>[]&nbsp;srcs,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Copy files between FileSystems.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.FileStatus-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</a>&nbsp;srcStatus,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
boolean&nbsp;overwrite,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Copy files between FileSystems.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-java.io.File-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;src,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;dstFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Copy local files to a FileSystem.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.io.File-boolean-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;boolean&nbsp;copy(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFS,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;src,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dst,
boolean&nbsp;deleteSource,
<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Copy FileSystem files to local files.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="makeShellPath-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makeShellPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;makeShellPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - The filename to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unix pathname</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on windows, there can be problems with the subprocess</dd>
</dl>
</li>
</ul>
<a name="makeShellPath-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makeShellPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;makeShellPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - The filename to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unix pathname</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on windows, there can be problems with the subprocess</dd>
</dl>
</li>
</ul>
<a name="makeSecureShellPath-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makeSecureShellPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;makeSecureShellPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convert a os-native filename to a path that works for the shell
and avoids script injection attacks.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - The filename to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unix pathname</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on windows, there can be problems with the subprocess</dd>
</dl>
</li>
</ul>
<a name="makeShellPath-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makeShellPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;makeShellPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
boolean&nbsp;makeCanonicalPath)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Convert a os-native filename to a path that works for the shell.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - The filename to convert</dd>
<dd><code>makeCanonicalPath</code> - Whether to make canonical path for the file passed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unix pathname</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - on windows, there can be problems with the subprocess</dd>
</dl>
</li>
</ul>
<a name="getDU-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDU</h4>
<pre>public static&nbsp;long&nbsp;getDU(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)</pre>
<div class="block">Takes an input dir and returns the du on that local directory. Very basic
implementation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dir</code> - The input dir to get the disk space of this local dir</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The total disk space of the input local directory</dd>
</dl>
</li>
</ul>
<a name="unZip-java.io.InputStream-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unZip</h4>
<pre>public static&nbsp;void&nbsp;unZip(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputStream,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;toDir)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Given a stream input it will unzip the it in the unzip directory.
passed as the second parameter</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The zip file as input</dd>
<dd><code>toDir</code> - The unzip directory where to unzip the zip file.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - an exception occurred</dd>
</dl>
</li>
</ul>
<a name="unZip-java.io.File-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unZip</h4>
<pre>public static&nbsp;void&nbsp;unZip(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inFile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;unzipDir)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Given a File input it will unzip it in the unzip directory.
passed as the second parameter</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inFile</code> - The zip file as input</dd>
<dd><code>unzipDir</code> - The unzip directory where to unzip the zip file.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - An I/O exception has occurred</dd>
</dl>
</li>
</ul>
<a name="unTar-java.io.InputStream-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unTar</h4>
<pre>public static&nbsp;void&nbsp;unTar(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;inputStream,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;untarDir,
boolean&nbsp;gzipped)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</a></pre>
<div class="block">Given a Tar File as input it will untar the file in a the untar directory
passed as the second parameter
This utility will untar ".tar" files and ".tar.gz","tgz" files.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputStream</code> - The tar file as input.</dd>
<dd><code>untarDir</code> - The untar directory where to untar the tar file.</dd>
<dd><code>gzipped</code> - The input stream is gzipped
TODO Use magic number and PusbackInputStream to identify</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - an exception occurred</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - command interrupted</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutionException.html?is-external=true" title="class or interface in java.util.concurrent">ExecutionException</a></code> - task submit failed</dd>
</dl>
</li>
</ul>
<a name="unTar-java.io.File-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unTar</h4>
<pre>public static&nbsp;void&nbsp;unTar(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;inFile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;untarDir)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Given a Tar File as input it will untar the file in a the untar directory
passed as the second parameter
This utility will untar ".tar" files and ".tar.gz","tgz" files.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inFile</code> - The tar file as input.</dd>
<dd><code>untarDir</code> - The untar directory where to untar the tar file.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="symLink-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>symLink</h4>
<pre>public static&nbsp;int&nbsp;symLink(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;target,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;linkname)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Create a soft link between a src and destination
only on a local disk. HDFS does not support this.
On Windows, when symlink creation fails due to security
setting, we will log a warning. The return code in this
case is 2.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target for symlink</dd>
<dd><code>linkname</code> - the symlink</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>0 on success</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="chmod-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chmod</h4>
<pre>public static&nbsp;int&nbsp;chmod(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;perm)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Change the permissions on a filename.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - the name of the file to change</dd>
<dd><code>perm</code> - the permission string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the exit code from the command</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code></dd>
</dl>
</li>
</ul>
<a name="chmod-java.lang.String-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chmod</h4>
<pre>public static&nbsp;int&nbsp;chmod(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;filename,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;perm,
boolean&nbsp;recursive)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Change the permissions on a file / directory, recursively, if
needed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>filename</code> - name of the file whose permissions are to change</dd>
<dd><code>perm</code> - permission string</dd>
<dd><code>recursive</code> - true, if permissions should be changed recursively</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the exit code from the command.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="setOwner-java.io.File-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOwner</h4>
<pre>public static&nbsp;void&nbsp;setOwner(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;username,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;groupname)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Set the ownership on a file / directory. User name and group name
cannot both be null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - the file to change</dd>
<dd><code>username</code> - the new user owner name</dd>
<dd><code>groupname</code> - the new group owner name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="setReadable-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setReadable</h4>
<pre>public static&nbsp;boolean&nbsp;setReadable(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;readable)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setReadable-boolean-" title="class or interface in java.io"><code>File.setReadable(boolean)</code></a>
File#setReadable does not work as expected on Windows.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dd><code>readable</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true on success, false otherwise</dd>
</dl>
</li>
</ul>
<a name="setWritable-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setWritable</h4>
<pre>public static&nbsp;boolean&nbsp;setWritable(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;writable)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setWritable-boolean-" title="class or interface in java.io"><code>File.setWritable(boolean)</code></a>
File#setWritable does not work as expected on Windows.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dd><code>writable</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true on success, false otherwise</dd>
</dl>
</li>
</ul>
<a name="setExecutable-java.io.File-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExecutable</h4>
<pre>public static&nbsp;boolean&nbsp;setExecutable(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
boolean&nbsp;executable)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#setExecutable-boolean-" title="class or interface in java.io"><code>File.setExecutable(boolean)</code></a>
File#setExecutable does not work as expected on Windows.
Note: revoking execute permission on folders does not have the same
behavior on Windows as on Unix platforms. Creating, deleting or renaming
a file within that folder will still succeed on Windows.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dd><code>executable</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true on success, false otherwise</dd>
</dl>
</li>
</ul>
<a name="canRead-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>canRead</h4>
<pre>public static&nbsp;boolean&nbsp;canRead(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canRead--" title="class or interface in java.io"><code>File.canRead()</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>On Unix, same as <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canRead--" title="class or interface in java.io"><code>File.canRead()</code></a>
On Windows, true if process has read access on the path</dd>
</dl>
</li>
</ul>
<a name="canWrite-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>canWrite</h4>
<pre>public static&nbsp;boolean&nbsp;canWrite(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canWrite--" title="class or interface in java.io"><code>File.canWrite()</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>On Unix, same as <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canWrite--" title="class or interface in java.io"><code>File.canWrite()</code></a>
On Windows, true if process has write access on the path</dd>
</dl>
</li>
</ul>
<a name="canExecute-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>canExecute</h4>
<pre>public static&nbsp;boolean&nbsp;canExecute(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
<div class="block">Platform independent implementation for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canExecute--" title="class or interface in java.io"><code>File.canExecute()</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - input file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>On Unix, same as <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#canExecute--" title="class or interface in java.io"><code>File.canExecute()</code></a>
On Windows, true if process has execute access on the path</dd>
</dl>
</li>
</ul>
<a name="setPermission-java.io.File-org.apache.hadoop.fs.permission.FsPermission-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPermission</h4>
<pre>public static&nbsp;void&nbsp;setPermission(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
<a href="../../../../org/apache/hadoop/fs/permission/FsPermission.html" title="class in org.apache.hadoop.fs.permission">FsPermission</a>&nbsp;permission)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Set permissions to the required value. Uses the java primitives instead
of forking if group == other.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - the file to change</dd>
<dd><code>permission</code> - the new permissions</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="createLocalTempFile-java.io.File-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createLocalTempFile</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;createLocalTempFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;basefile,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;prefix,
boolean&nbsp;isDeleteOnExit)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Create a tmp file for a base file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>basefile</code> - the base file of the tmp</dd>
<dd><code>prefix</code> - file name prefix of tmp</dd>
<dd><code>isDeleteOnExit</code> - if true, the tmp will be deleted when the VM exits</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a newly created tmp file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If a tmp file cannot created</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#createTempFile-java.lang.String-java.lang.String-java.io.File-" title="class or interface in java.io"><code>File.createTempFile(String, String, File)</code></a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#deleteOnExit--" title="class or interface in java.io"><code>File.deleteOnExit()</code></a></dd>
</dl>
</li>
</ul>
<a name="replaceFile-java.io.File-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>replaceFile</h4>
<pre>public static&nbsp;void&nbsp;replaceFile(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;src,
<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;target)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Move the src file to the name specified by target.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>src</code> - the source file</dd>
<dd><code>target</code> - the target file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If this operation fails</dd>
</dl>
</li>
</ul>
<a name="listFiles-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listFiles</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]&nbsp;listFiles(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A wrapper for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#listFiles--" title="class or interface in java.io"><code>File.listFiles()</code></a>. This java.io API returns null
when a dir is not a directory or for any I/O error. Instead of having
null check everywhere File#listFiles() is used, we will add utility API
to get around this problem. For the majority of cases where we prefer
an IOException to be thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dir</code> - directory for which listing should be performed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>list of files or empty list</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - for invalid directory or for a bad disk.</dd>
</dl>
</li>
</ul>
<a name="list-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>list</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;list(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;dir)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A wrapper for <a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true#list--" title="class or interface in java.io"><code>File.list()</code></a>. This java.io API returns null
when a dir is not a directory or for any I/O error. Instead of having
null check everywhere File#list() is used, we will add utility API
to get around this problem. For the majority of cases where we prefer
an IOException to be thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dir</code> - directory for which listing should be performed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>list of file names or empty string list</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/AccessDeniedException.html?is-external=true" title="class or interface in java.nio.file">AccessDeniedException</a></code> - for unreadable directory</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - for invalid directory or for bad disk</dd>
</dl>
</li>
</ul>
<a name="createJarWithClassPath-java.lang.String-org.apache.hadoop.fs.Path-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createJarWithClassPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;createJarWithClassPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;inputClassPath,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;pwd,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;callerEnv)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="createJarWithClassPath-java.lang.String-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Path-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createJarWithClassPath</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;createJarWithClassPath(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;inputClassPath,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;pwd,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;targetDir,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;callerEnv)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Create a jar file at the given path, containing a manifest with a classpath
that references all specified entries.
Some platforms may have an upper limit on command line length. For example,
the maximum command line length on Windows is 8191 characters, but the
length of the classpath may exceed this. To work around this limitation,
use this method to create a small intermediate jar with a manifest that
contains the full classpath. It returns the absolute path to the new jar,
which the caller may set as the classpath for a new process.
Environment variable evaluation is not supported within a jar manifest, so
this method expands environment variables before inserting classpath entries
to the manifest. The method parses environment variables according to
platform-specific syntax (%VAR% on Windows, or $VAR otherwise). On Windows,
environment variables are case-insensitive. For example, %VAR% and %var%
evaluate to the same value.
Specifying the classpath in a jar manifest does not support wildcards, so
this method expands wildcards internally. Any classpath entry that ends
with * is translated to all files at that path with extension .jar or .JAR.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputClassPath</code> - String input classpath to bundle into the jar manifest</dd>
<dd><code>pwd</code> - Path to working directory to save jar</dd>
<dd><code>targetDir</code> - path to where the jar execution will have its working dir</dd>
<dd><code>callerEnv</code> - Map &lt;String, String&gt; caller's
environment variables to use for expansion</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String[] with absolute path to new jar in position 0 and
unexpanded wild card entry path in position 1</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is an I/O error while writing the jar file</dd>
</dl>
</li>
</ul>
<a name="getJarsInDirectory-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJarsInDirectory</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&gt;&nbsp;getJarsInDirectory(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path)</pre>
<div class="block">Returns all jars that are in the directory. It is useful in expanding a
wildcard path to return all jars from the directory to use in a classpath.
It operates only on local paths.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - the path to the directory. The path may include the wildcard.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the list of jars as URLs, or an empty list if there are no jars, or
the directory does not exist locally</dd>
</dl>
</li>
</ul>
<a name="getJarsInDirectory-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJarsInDirectory</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&gt;&nbsp;getJarsInDirectory(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;path,
boolean&nbsp;useLocal)</pre>
<div class="block">Returns all jars that are in the directory. It is useful in expanding a
wildcard path to return all jars from the directory to use in a classpath.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - the path to the directory. The path may include the wildcard.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the list of jars as URLs, or an empty list if there are no jars, or
the directory does not exist</dd>
</dl>
</li>
</ul>
<a name="compareFs-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.FileSystem-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compareFs</h4>
<pre>public static&nbsp;boolean&nbsp;compareFs(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;srcFs,
<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;destFs)</pre>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
byte[]&nbsp;bytes)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Writes bytes to a file. This utility method opens the file for writing,
creating the file if it does not exist, or overwrites an existing file. All
bytes in the byte array are written to the file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fs</code> - the file system with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>bytes</code> - the byte array with the bytes to write</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file system</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
byte[]&nbsp;bytes)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Writes bytes to a file. This utility method opens the file for writing,
creating the file if it does not exist, or overwrites an existing file. All
bytes in the byte array are written to the file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileContext</code> - the file context with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>bytes</code> - the byte array with the bytes to write</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file context</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.Iterable-java.nio.charset.Charset-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&gt;&nbsp;lines,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write lines of text to a file. Each line is a char sequence and is written
to the file in sequence with each line terminated by the platform's line
separator, as defined by the system property <code>line.separator</code>. Characters are encoded into bytes using the specified
charset. This utility method opens the file for writing, creating the file
if it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fs</code> - the file system with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>lines</code> - a Collection to iterate over the char sequences</dd>
<dd><code>cs</code> - the charset to use for encoding</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file system</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.Iterable-java.nio.charset.Charset-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&gt;&nbsp;lines,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write lines of text to a file. Each line is a char sequence and is written
to the file in sequence with each line terminated by the platform's line
separator, as defined by the system property <code>line.separator</code>. Characters are encoded into bytes using the specified
charset. This utility method opens the file for writing, creating the file
if it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileContext</code> - the file context with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>lines</code> - a Collection to iterate over the char sequences</dd>
<dd><code>cs</code> - the charset to use for encoding</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file context</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.CharSequence-java.nio.charset.Charset-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write a line of text to a file. Characters are encoded into bytes using the
specified charset. This utility method opens the file for writing, creating
the file if it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fs</code> - the file system with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>charseq</code> - the char sequence to write to the file</dd>
<dd><code>cs</code> - the charset to use for encoding</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file system</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.CharSequence-java.nio.charset.Charset-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq,
<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</a>&nbsp;cs)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write a line of text to a file. Characters are encoded into bytes using the
specified charset. This utility method opens the file for writing, creating
the file if it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>FileContext</code> - the file context with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>charseq</code> - the char sequence to write to the file</dd>
<dd><code>cs</code> - the charset to use for encoding</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file context</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-java.lang.CharSequence-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</a>&nbsp;fs,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write a line of text to a file. Characters are encoded into bytes using
UTF-8. This utility method opens the file for writing, creating the file if
it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fs</code> - the files system with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>charseq</code> - the char sequence to write to the file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file system</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</dd>
</dl>
</li>
</ul>
<a name="write-org.apache.hadoop.fs.FileContext-org.apache.hadoop.fs.Path-java.lang.CharSequence-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>write</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;write(<a href="../../../../org/apache/hadoop/fs/FileContext.html" title="class in org.apache.hadoop.fs">FileContext</a>&nbsp;fileContext,
<a href="../../../../org/apache/hadoop/fs/Path.html" title="class in org.apache.hadoop.fs">Path</a>&nbsp;path,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</a>&nbsp;charseq)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Write a line of text to a file. Characters are encoded into bytes using
UTF-8. This utility method opens the file for writing, creating the file if
it does not exist, or overwrites an existing file.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileContext</code> - the files system with which to create the file</dd>
<dd><code>path</code> - the path to the file</dd>
<dd><code>charseq</code> - the char sequence to write to the file</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the file context</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the arguments are <code>null</code></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/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 creating or writing to the file</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/FileUtil.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/hadoop/fs/FileSystem.Statistics.StatisticsData.html" title="class in org.apache.hadoop.fs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/fs/FileUtil.HardLink.html" title="class in org.apache.hadoop.fs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/fs/FileUtil.html" target="_top">Frames</a></li>
<li><a href="FileUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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 &#169; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>