<! DOCTYPE HTML>
<!--  NewPage -->
<html lang="en">
<head>
<!--  Generated by javadoc -->
<title>PosixFilePermissions (Java SE 12 &amp; JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.nio.file.attribute. PosixFilePermissions class">
<meta name="keywords" content="toString()">
<meta name="keywords" content="fromString()">
<meta name="keywords" content="asFileAttribute()">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<! --[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![ endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="PosixFilePermissions (Java SE 12 & JDK 12 )";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":9,"i1":9,"i2":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";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!--  ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!--    -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!--    -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PosixFilePermissions.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-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!--    -->
</a>
<!--  ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!--  ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../../../module-summary.html">java.base</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">java.nio.file.attribute</a></div>
<h2 title="Class PosixFilePermissions" class="title">Class PosixFilePermissions</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../lang/Object.html" title="class in java.lang">java.lang. Object</a></li>
<li>
<ul class="inheritance">
<li>java.nio.file.attribute. PosixFilePermissions</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public final class <span class="typeNameLabel">PosixFilePermissions</span>
extends <a href="../../../lang/Object.html" title="class in java.lang">Object</a></pre>
<div class="block">This class consists exclusively of static methods that operate on sets of
 <a href="PosixFilePermission.html" title="enum in java.nio.file.attribute"><code>PosixFilePermission</code></a> objects.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.7</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!--  ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!--    -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>static <a href="FileAttribute.html" title="interface in java.nio.file.attribute">FileAttribute</a>&lt;<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asFileAttribute(java.util. Set)">asFileAttribute</a></span>&#8203;(<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</code></th>
<td class="colLast">
<div class="block">Creates a <a href="FileAttribute.html" title="interface in java.nio.file.attribute"><code>FileAttribute</code></a>, encapsulating a copy of the given file
 permissions, suitable for passing to the <a href="../Files.html#createFile(java.nio.file. Path,java.nio.file.attribute. FileAttribute...)"><code>createFile</code></a> or <a href="../Files.html#createDirectory(java.nio.file. Path,java.nio.file.attribute. FileAttribute...)"><code>createDirectory</code></a>
 methods.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>static <a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromString(java.lang. String)">fromString</a></span>&#8203;(<a href="../../../lang/String.html" title="class in java.lang">String</a>&nbsp;perms)</code></th>
<td class="colLast">
<div class="block">Returns the set of permissions corresponding to a given <code>String</code>
 representation.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>static <a href="../../../lang/String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString(java.util. Set)">toString</a></span>&#8203;(<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</code></th>
<td class="colLast">
<div class="block">Returns the <code>String</code> representation of a set of permissions.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang. Object">
<!--    -->
</a>
<h3>Methods declared in class&nbsp;java.lang.<a href="../../../lang/Object.html" title="class in java.lang">Object</a></h3>
<code><a href="../../../lang/Object.html#clone()">clone</a>, <a href="../../../lang/Object.html#equals(java.lang. Object)">equals</a>, <a href="../../../lang/Object.html#finalize()">finalize</a>, <a href="../../../lang/Object.html#getClass()">getClass</a>, <a href="../../../lang/Object.html#hashCode()">hashCode</a>, <a href="../../../lang/Object.html#notify()">notify</a>, <a href="../../../lang/Object.html#notifyAll()">notifyAll</a>, <a href="../../../lang/Object.html#toString()">toString</a>, <a href="../../../lang/Object.html#wait()">wait</a>, <a href="../../../lang/Object.html#wait(long)">wait</a>, <a href="../../../lang/Object.html#wait(long,int)">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!--  ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!--    -->
</a>
<h3>Method Detail</h3>
<a id="toString(java.util. Set)">
<!--    -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public static&nbsp;<a href="../../../lang/String.html" title="class in java.lang">String</a>&nbsp;toString&#8203;(<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</pre>
<div class="block">Returns the <code>String</code> representation of a set of permissions.  It
 is guaranteed that the returned <code>String</code> can be parsed by the
 <a href="#fromString(java.lang. String)"><code>fromString(java.lang. String)</code></a> method. 

 <p> If the set contains <code>null</code> or elements that are not of type
 <code>PosixFilePermission</code> then these elements are ignored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>perms</code> - the set of permissions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string representation of the permission set</dd>
</dl>
</li>
</ul>
<a id="fromString(java.lang. String)">
<!--    -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromString</h4>
<pre class="methodSignature">public static&nbsp;<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;fromString&#8203;(<a href="../../../lang/String.html" title="class in java.lang">String</a>&nbsp;perms)</pre>
<div class="block">Returns the set of permissions corresponding to a given <code>String</code>
 representation. 

 <p> The <code>perms</code> parameter is a <code>String</code> representing the
 permissions.  It has 9 characters that are interpreted as three sets of
 three.  The first set refers to the owner's permissions; the next to the
 group permissions and the last to others.  Within each set, the first
 character is <code>'r'</code> to indicate permission to read, the second
 character is <code>'w'</code> to indicate permission to write, and the third
 character is <code>'x'</code> for execute permission.  Where a permission is
 not set then the corresponding character is set to <code>'-'</code>. 

 <p> <b>Usage Example:</b>
 Suppose we require the set of permissions that indicate the owner has read,
 write, and execute permissions, the group has read and execute permissions
 and others have none. 
 <pre>
   Set&lt;PosixFilePermission&gt; perms = PosixFilePermissions.fromString("rwxr-x---");
 </pre></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>perms</code> - string representing a set of permissions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the resulting set of permissions</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the string cannot be converted to a set of permissions</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="#toString(java.util. Set)"><code>toString(Set)</code></a></dd>
</dl>
</li>
</ul>
<a id="asFileAttribute(java.util. Set)">
<!--    -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>asFileAttribute</h4>
<pre class="methodSignature">public static&nbsp;<a href="FileAttribute.html" title="interface in java.nio.file.attribute">FileAttribute</a>&lt;<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&gt;&nbsp;asFileAttribute&#8203;(<a href="../../../util/Set.html" title="interface in java.util">Set</a>&lt;<a href="PosixFilePermission.html" title="enum in java.nio.file.attribute">PosixFilePermission</a>&gt;&nbsp;perms)</pre>
<div class="block">Creates a <a href="FileAttribute.html" title="interface in java.nio.file.attribute"><code>FileAttribute</code></a>, encapsulating a copy of the given file
 permissions, suitable for passing to the <a href="../Files.html#createFile(java.nio.file. Path,java.nio.file.attribute. FileAttribute...)"><code>createFile</code></a> or <a href="../Files.html#createDirectory(java.nio.file. Path,java.nio.file.attribute. FileAttribute...)"><code>createDirectory</code></a>
 methods.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>perms</code> - the set of permissions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an attribute encapsulating the given file permissions with
          <a href="FileAttribute.html#name()"><code>name</code></a> <code>"posix:permissions"</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../lang/ClassCastException.html" title="class in java.lang">ClassCastException</a></code> - if the set contains elements that are not of type <code>
          PosixFilePermission</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!--  ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!--  ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!--    -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!--    -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PosixFilePermissions.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-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!--    -->
</a>
<!--  ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&amp;id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../../../legal/copyright.html">Copyright</a> &copy; 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved.  Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>.  <!--  Version 12.0.2+10 --></small></p>
</footer>
</body>
</html>
