blob: 00dbd0c1f3622f18a3591544068e16f8ed452871 [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_66) on Fri Jan 15 14:33:43 CET 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IoUtils (Apache Mina SSHD :: Core 1.1.0 API)</title>
<meta name="date" content="2016-01-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="IoUtils (Apache Mina SSHD :: Core 1.1.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":9,"i20":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete 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/IoUtils.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/sshd/common/util/io/InputStreamWithChannel.html" title="class in org.apache.sshd.common.util.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/sshd/common/util/io/LimitInputStream.html" title="class in org.apache.sshd.common.util.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/sshd/common/util/io/IoUtils.html" target="_top">Frames</a></li>
<li><a href="IoUtils.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&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.sshd.common.util.io</div>
<h2 title="Class IoUtils" class="title">Class IoUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.sshd.common.util.io.IoUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <span class="typeNameLabel">IoUtils</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">TODO Add javadoc</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd><a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&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/sshd/common/util/io/IoUtils.html#DEFAULT_COPY_SIZE">DEFAULT_COPY_SIZE</a></span></code>
<div class="block">Size of preferred work buffer when reading / writing data to / from streams</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/CopyOption.html?is-external=true" title="class or interface in java.nio.file">CopyOption</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#EMPTY_COPY_OPTIONS">EMPTY_COPY_OPTIONS</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#EMPTY_LINK_OPTIONS">EMPTY_LINK_OPTIONS</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/OpenOption.html?is-external=true" title="class or interface in java.nio.file">OpenOption</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#EMPTY_OPEN_OPTIONS">EMPTY_OPEN_OPTIONS</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#EOL">EOL</a></span></code>
<div class="block">The local O/S line separator</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#WINDOWS_EXECUTABLE_EXTENSIONS">WINDOWS_EXECUTABLE_EXTENSIONS</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></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#appendPathComponent-java.lang.String-java.lang.String-">appendPathComponent</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;prefix,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;component)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#checkFileExists-java.nio.file.Path-java.nio.file.LinkOption...-">checkFileExists</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</code>
<div class="block">Checks if a file exists - <B>Note:</B> according to the
<A HREF="http://docs.oracle.com/javase/tutorial/essential/io/check.html">Java tutorial - Checking a File or Directory</A>:</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#closeQuietly-java.io.Closeable...-">closeQuietly</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>...&nbsp;closeables)</code>
<div class="block">Closes a bunch of resources suppressing any <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a>s their
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io"><code>Closeable.close()</code></a> method may have thrown</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#copy-java.io.InputStream-java.io.OutputStream-">copy</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;source,
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;sink)</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#copy-java.io.InputStream-java.io.OutputStream-int-">copy</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;source,
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;sink,
int&nbsp;bufferSize)</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#ensureDirectory-java.nio.file.Path-java.nio.file.LinkOption...-">ensureDirectory</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</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/sshd/common/util/io/IoUtils.html#followLinks-java.nio.file.LinkOption...-">followLinks</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getEOLBytes--">getEOLBytes</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getFileOwner-java.nio.file.Path-java.nio.file.LinkOption...-">getFileOwner</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</code>
<div class="block">Get file owner.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getLinkOptions-boolean-">getLinkOptions</a></span>(boolean&nbsp;followLinks)</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getPermissions-java.nio.file.Path-java.nio.file.LinkOption...-">getPermissions</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</code>
<div class="block">If the &quot;posix&quot; view is supported, then it returns
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html?is-external=true#getPosixFilePermissions-java.nio.file.Path-java.nio.file.LinkOption...-" title="class or interface in java.nio.file"><code>Files.getPosixFilePermissions(Path, LinkOption...)</code></a>, otherwise
uses the <a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getPermissionsFromFile-java.io.File-"><code>getPermissionsFromFile(File)</code></a> method</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getPermissionsFromFile-java.io.File-">getPermissionsFromFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>&nbsp;</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#isExecutable-java.io.File-">isExecutable</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#isWindowsExecutable-java.lang.String-">isWindowsExecutable</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;fileName)</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#read-java.io.InputStream-byte:A-">read</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer)</code>
<div class="block">Read as many bytes as possible until EOF or achieved required length</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#read-java.io.InputStream-byte:A-int-int-">read</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;length)</code>
<div class="block">Read as many bytes as possible until EOF or achieved required length</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#readFully-java.io.InputStream-byte:A-">readFully</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer)</code>
<div class="block">Read the requested number of bytes or fail if there are not enough left.</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/sshd/common/util/io/IoUtils.html#readFully-java.io.InputStream-byte:A-int-int-">readFully</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;length)</code>
<div class="block">Read the requested number of bytes or fail if there are not enough left.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#setPermissions-java.nio.file.Path-java.util.Set-">setPermissions</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</code>
<div class="block">If the &quot;posix&quot; view is supported, then it invokes
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html?is-external=true#setPosixFilePermissions-java.nio.file.Path-java.util.Set-" title="class or interface in java.nio.file"><code>Files.setPosixFilePermissions(Path, Set)</code></a>, otherwise
uses the <a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#setPermissionsToFile-java.io.File-java.util.Collection-"><code>setPermissionsToFile(File, Collection)</code></a> method</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#setPermissionsToFile-java.io.File-java.util.Collection-">setPermissionsToFile</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</code>&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#validateExcludedPermissions-java.util.Collection-java.util.Collection-">validateExcludedPermissions</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;excluded)</code>&nbsp;</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="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="EMPTY_OPEN_OPTIONS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EMPTY_OPEN_OPTIONS</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/OpenOption.html?is-external=true" title="class or interface in java.nio.file">OpenOption</a>[] EMPTY_OPEN_OPTIONS</pre>
</li>
</ul>
<a name="EMPTY_COPY_OPTIONS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EMPTY_COPY_OPTIONS</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/CopyOption.html?is-external=true" title="class or interface in java.nio.file">CopyOption</a>[] EMPTY_COPY_OPTIONS</pre>
</li>
</ul>
<a name="EMPTY_LINK_OPTIONS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EMPTY_LINK_OPTIONS</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>[] EMPTY_LINK_OPTIONS</pre>
</li>
</ul>
<a name="WINDOWS_EXECUTABLE_EXTENSIONS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>WINDOWS_EXECUTABLE_EXTENSIONS</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt; WINDOWS_EXECUTABLE_EXTENSIONS</pre>
</li>
</ul>
<a name="DEFAULT_COPY_SIZE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_COPY_SIZE</h4>
<pre>public static final&nbsp;int DEFAULT_COPY_SIZE</pre>
<div class="block">Size of preferred work buffer when reading / writing data to / from streams</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.sshd.common.util.io.IoUtils.DEFAULT_COPY_SIZE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="EOL">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EOL</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> EOL</pre>
<div class="block">The local O/S line separator</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getEOLBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEOLBytes</h4>
<pre>public static&nbsp;byte[]&nbsp;getEOLBytes()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The local platform line separator bytes as UTF-8. <B>Note:</B>
each call returns a <U>new</U> instance in order to avoid inadvertent
changes in shared objects</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#EOL"><code>EOL</code></a></dd>
</dl>
</li>
</ul>
<a name="getLinkOptions-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLinkOptions</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>[]&nbsp;getLinkOptions(boolean&nbsp;followLinks)</pre>
</li>
</ul>
<a name="copy-java.io.InputStream-java.io.OutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;long&nbsp;copy(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;source,
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;sink)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="copy-java.io.InputStream-java.io.OutputStream-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public static&nbsp;long&nbsp;copy(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;source,
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&nbsp;sink,
int&nbsp;bufferSize)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="closeQuietly-java.io.Closeable...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closeQuietly</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>&nbsp;closeQuietly(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>...&nbsp;closeables)</pre>
<div class="block">Closes a bunch of resources suppressing any <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a>s their
<a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io"><code>Closeable.close()</code></a> method may have thrown</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>closeables</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><code>Closeable</code></a>s to close</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The <U>first</U> <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a> that occurred during closing
of a resource - if more than one exception occurred, they are added as
suppressed exceptions to the first one</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html?is-external=true#getSuppressed--" title="class or interface in java.lang"><code>Throwable.getSuppressed()</code></a></dd>
</dl>
</li>
</ul>
<a name="isWindowsExecutable-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isWindowsExecutable</h4>
<pre>public static&nbsp;boolean&nbsp;isWindowsExecutable(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;fileName)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileName</code> - The file name to be evaluated - ignored if <code>null</code>/empty</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the file ends in one of the <a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#WINDOWS_EXECUTABLE_EXTENSIONS"><code>WINDOWS_EXECUTABLE_EXTENSIONS</code></a></dd>
</dl>
</li>
</ul>
<a name="getPermissions-java.nio.file.Path-java.nio.file.LinkOption...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPermissions</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;getPermissions(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">If the &quot;posix&quot; view is supported, then it returns
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html?is-external=true#getPosixFilePermissions-java.nio.file.Path-java.nio.file.LinkOption...-" title="class or interface in java.nio.file"><code>Files.getPosixFilePermissions(Path, LinkOption...)</code></a>, otherwise
uses the <a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#getPermissionsFromFile-java.io.File-"><code>getPermissionsFromFile(File)</code></a> method</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file"><code>Path</code></a></dd>
<dd><code>options</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file"><code>LinkOption</code></a>s to use when querying the permissions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util"><code>Set</code></a> of <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If failed to access the file system in order to
retrieve the permissions</dd>
</dl>
</li>
</ul>
<a name="getPermissionsFromFile-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPermissionsFromFile</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;getPermissionsFromFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a> to be checked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util"><code>Set</code></a> of <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a>s based on whether
the file is readable/writable/executable. If so, then <U>all</U> the
relevant permissions are set (i.e., owner, group and others)</dd>
</dl>
</li>
</ul>
<a name="isExecutable-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isExecutable</h4>
<pre>public static&nbsp;boolean&nbsp;isExecutable(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f)</pre>
</li>
</ul>
<a name="setPermissions-java.nio.file.Path-java.util.Set-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPermissions</h4>
<pre>public static&nbsp;void&nbsp;setPermissions(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">If the &quot;posix&quot; view is supported, then it invokes
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html?is-external=true#setPosixFilePermissions-java.nio.file.Path-java.util.Set-" title="class or interface in java.nio.file"><code>Files.setPosixFilePermissions(Path, Set)</code></a>, otherwise
uses the <a href="../../../../../../org/apache/sshd/common/util/io/IoUtils.html#setPermissionsToFile-java.io.File-java.util.Collection-"><code>setPermissionsToFile(File, Collection)</code></a> method</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file"><code>Path</code></a></dd>
<dd><code>perms</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util"><code>Set</code></a> of <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a>s</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If failed to access the file system</dd>
</dl>
</li>
</ul>
<a name="setPermissionsToFile-java.io.File-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPermissionsToFile</h4>
<pre>public static&nbsp;void&nbsp;setPermissionsToFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;f,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io"><code>File</code></a></dd>
<dd><code>perms</code> - A <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util"><code>Collection</code></a> of <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a>s to set on it.
<B>Note:</B> the file is set to readable/writable/executable not only by the
owner if <U>any</U> of relevant the owner/group/others permission is set</dd>
</dl>
</li>
</ul>
<a name="getFileOwner-java.nio.file.Path-java.nio.file.LinkOption...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFileOwner</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getFileOwner(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block"><P>Get file owner.</P></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file"><code>Path</code></a></dd>
<dd><code>options</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file"><code>LinkOption</code></a>s to use when querying the owner</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Owner of the file or null if unsupported. <B>Note:</B> for
<I>Windows</I> it strips any prepended domain or group name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If failed to access the file system</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html?is-external=true#getOwner-java.nio.file.Path-java.nio.file.LinkOption...-" title="class or interface in java.nio.file"><code>Files.getOwner(Path, LinkOption...)</code></a></dd>
</dl>
</li>
</ul>
<a name="checkFileExists-java.nio.file.Path-java.nio.file.LinkOption...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkFileExists</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>&nbsp;checkFileExists(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</pre>
<div class="block"><P>Checks if a file exists - <B>Note:</B> according to the
<A HREF="http://docs.oracle.com/javase/tutorial/essential/io/check.html">Java tutorial - Checking a File or Directory</A>:
</P>
<PRE>
The methods in the Path class are syntactic, meaning that they operate
on the Path instance. But eventually you must access the file system
to verify that a particular Path exists, or does not exist. You can do
so with the exists(Path, LinkOption...) and the notExists(Path, LinkOption...)
methods. Note that !Files.exists(path) is not equivalent to Files.notExists(path).
When you are testing a file's existence, three results are possible:
- The file is verified to exist.
- The file is verified to not exist.
- The file's status is unknown.
This result can occur when the program does not have access to the file.
If both exists and notExists return false, the existence of the file cannot
be verified.
</PRE></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file"><code>Path</code></a> to be tested</dd>
<dd><code>options</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file"><code>LinkOption</code></a>s to use</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html?is-external=true#TRUE" title="class or interface in java.lang"><code>Boolean.TRUE</code></a>/<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html?is-external=true#FALSE" title="class or interface in java.lang"><code>Boolean.FALSE</code></a> or <code>null</code>
according to the file status as explained above</dd>
</dl>
</li>
</ul>
<a name="readFully-java.io.InputStream-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readFully</h4>
<pre>public static&nbsp;void&nbsp;readFully(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Read the requested number of bytes or fail if there are not enough left.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>input</code> - where to read input from</dd>
<dd><code>buffer</code> - destination</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is a problem reading the file</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the number of bytes read was incorrect</dd>
</dl>
</li>
</ul>
<a name="readFully-java.io.InputStream-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readFully</h4>
<pre>public static&nbsp;void&nbsp;readFully(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;length)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Read the requested number of bytes or fail if there are not enough left.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>input</code> - where to read input from</dd>
<dd><code>buffer</code> - destination</dd>
<dd><code>offset</code> - initial offset into buffer</dd>
<dd><code>length</code> - length to read, must be &ge; 0</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if there is a problem reading the file</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</a></code> - if the number of bytes read was incorrect</dd>
</dl>
</li>
</ul>
<a name="read-java.io.InputStream-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public static&nbsp;int&nbsp;read(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Read as many bytes as possible until EOF or achieved required length</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>input</code> - where to read input from</dd>
<dd><code>buffer</code> - destination</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>actual length read; may be less than requested if EOF was reached</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if a read error occurs</dd>
</dl>
</li>
</ul>
<a name="read-java.io.InputStream-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public static&nbsp;int&nbsp;read(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a>&nbsp;input,
byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;length)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Read as many bytes as possible until EOF or achieved required length</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>input</code> - where to read input from</dd>
<dd><code>buffer</code> - destination</dd>
<dd><code>offset</code> - initial offset into buffer</dd>
<dd><code>length</code> - length to read - ignored if non-positive</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>actual length read; may be less than requested if EOF was reached</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if a read error occurs</dd>
</dl>
</li>
</ul>
<a name="validateExcludedPermissions-java.util.Collection-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateExcludedPermissions</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&nbsp;validateExcludedPermissions(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms,
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;excluded)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>perms</code> - The current <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a>s - ignored if <code>null</code>/empty</dd>
<dd><code>excluded</code> - The permissions <U>not</U> allowed to exist - ignored if <code>null</code>/empty</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The violating <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermission.html?is-external=true" title="class or interface in java.nio.file.attribute"><code>PosixFilePermission</code></a> - <code>null</code>
if no violating permission found</dd>
</dl>
</li>
</ul>
<a name="ensureDirectory-java.nio.file.Path-java.nio.file.LinkOption...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ensureDirectory</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;ensureDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;path,
<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>path</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file"><code>Path</code></a> to check</dd>
<dd><code>options</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file"><code>LinkOption</code></a>s to use when checking if path is a directory</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The same input path if it is a directory</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</a></code> - if input path not a directory</dd>
</dl>
</li>
</ul>
<a name="followLinks-java.nio.file.LinkOption...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>followLinks</h4>
<pre>public static&nbsp;boolean&nbsp;followLinks(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file">LinkOption</a>...&nbsp;options)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>options</code> - The <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true" title="class or interface in java.nio.file"><code>LinkOption</code></a>s - OK if <code>null</code>/empty</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if the link options are <code>null</code>/empty or do
not contain <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/LinkOption.html?is-external=true#NOFOLLOW_LINKS" title="class or interface in java.nio.file"><code>LinkOption.NOFOLLOW_LINKS</code></a>, <code>false</code> otherwise
(i.e., the array is not empty and contains the special value)</dd>
</dl>
</li>
</ul>
<a name="appendPathComponent-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>appendPathComponent</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;appendPathComponent(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;prefix,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;component)</pre>
</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/IoUtils.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/sshd/common/util/io/InputStreamWithChannel.html" title="class in org.apache.sshd.common.util.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/sshd/common/util/io/LimitInputStream.html" title="class in org.apache.sshd.common.util.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/sshd/common/util/io/IoUtils.html" target="_top">Frames</a></li>
<li><a href="IoUtils.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&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;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>