|
@@ -2296,18 +2296,18 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set the xattr of a file or directory.
|
|
|
- * Name must be prefixed with user/trusted/security/system which
|
|
|
- * followed by ".", For example "user.attr".
|
|
|
+ * Set an xattr of a file or directory.
|
|
|
+ * The name must be prefixed with user/trusted/security/system and
|
|
|
+ * followed by ".". For example, "user.attr".
|
|
|
* <p/>
|
|
|
- * A regular user only can set xattr of "user" namespace.
|
|
|
- * A super user can set xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ * A regular user can only set an xattr for the "user" namespace.
|
|
|
+ * The super user can set an xattr of either the "user" or "trusted" namespaces.
|
|
|
+ * The xattrs of the "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
* <p/>
|
|
|
- * For xattr of "user" namespace, its access permissions are
|
|
|
- * defined by the file or directory permission bits.
|
|
|
- * XAttr will be set only when login user has correct permissions.
|
|
|
+ * The access permissions of an xattr in the "user" namespace are
|
|
|
+ * defined by the file and directory permission bits.
|
|
|
+ * An xattr can only be set when the logged-in user has the correct permissions.
|
|
|
* If the xattr exists, it will be replaced.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
@@ -2325,18 +2325,19 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Set the xattr of a file or directory.
|
|
|
- * Name must be prefixed with user/trusted/security/system which
|
|
|
- * followed by ".", For example "user.attr".
|
|
|
+ * Set an xattr of a file or directory.
|
|
|
+ * The name must be prefixed with user/trusted/security/system and
|
|
|
+ * followed by ".". For example, "user.attr".
|
|
|
* <p/>
|
|
|
- * A regular user only can set xattr of "user" namespace.
|
|
|
- * A super user can set xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ * A regular user can only set an xattr for the "user" namespace.
|
|
|
+ * The super user can set an xattr of either the "user" or "trusted" namespaces.
|
|
|
+ * The xattrs of the "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
* <p/>
|
|
|
- * For xattr of "user" namespace, its access permissions are
|
|
|
- * defined by the file or directory permission bits.
|
|
|
- * XAttr will be set only when login user has correct permissions.
|
|
|
+ * The access permissions of an xattr in the "user" namespace are
|
|
|
+ * defined by the file and directory permission bits.
|
|
|
+ * An xattr can only be set when the logged-in user has the correct permissions.
|
|
|
+ * If the xattr exists, it will be replaced.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
|
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
|
|
@@ -2349,7 +2350,7 @@ public final class FileContext {
|
|
|
*/
|
|
|
public void setXAttr(Path path, final String name, final byte[] value,
|
|
|
final EnumSet<XAttrSetFlag> flag) throws IOException {
|
|
|
- Path absF = fixRelativePart(path);
|
|
|
+ final Path absF = fixRelativePart(path);
|
|
|
new FSLinkResolver<Void>() {
|
|
|
@Override
|
|
|
public Void next(final AbstractFileSystem fs, final Path p)
|
|
@@ -2361,15 +2362,17 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get xattr of a file or directory.
|
|
|
- * Name must be prefixed with user/trusted/security/system.
|
|
|
+ * Get an xattr for a file or directory.
|
|
|
+ * The name must be prefixed with user/trusted/security/system and
|
|
|
+ * followed by ".". For example, "user.attr".
|
|
|
* <p/>
|
|
|
- * A regular user only can get xattr of "user" namespace.
|
|
|
- * A super user can get xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ *
|
|
|
+ * A regular user can only get an xattr for the "user" namespace.
|
|
|
+ * The super user can get an xattr of either the "user" or "trusted" namespaces.
|
|
|
+ * The xattrs of the "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
* <p/>
|
|
|
- * XAttr will be returned only when login user has correct permissions.
|
|
|
+ * An xattr will only be returned when the logged-in user has the correct permissions.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
|
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
|
|
@@ -2380,7 +2383,7 @@ public final class FileContext {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public byte[] getXAttr(Path path, final String name) throws IOException {
|
|
|
- Path absF = fixRelativePart(path);
|
|
|
+ final Path absF = fixRelativePart(path);
|
|
|
return new FSLinkResolver<byte[]>() {
|
|
|
@Override
|
|
|
public byte[] next(final AbstractFileSystem fs, final Path p)
|
|
@@ -2391,13 +2394,14 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get all xattrs of a file or directory.
|
|
|
- * Only xattrs which login user has correct permissions will be returned.
|
|
|
+ * Get all of the xattrs for a file or directory.
|
|
|
+ * Only those xattrs for which the logged-in user has permissions to view
|
|
|
+ * are returned.
|
|
|
* <p/>
|
|
|
- * A regular user only can get xattr of "user" namespace.
|
|
|
- * A super user can get xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ * A regular user can only get xattrs for the "user" namespace.
|
|
|
+ * The super user can only get xattrs for "user" and "trusted" namespaces.
|
|
|
+ * The xattr of "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
|
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
|
|
@@ -2407,7 +2411,7 @@ public final class FileContext {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
|
|
|
- Path absF = fixRelativePart(path);
|
|
|
+ final Path absF = fixRelativePart(path);
|
|
|
return new FSLinkResolver<Map<String, byte[]>>() {
|
|
|
@Override
|
|
|
public Map<String, byte[]> next(final AbstractFileSystem fs, final Path p)
|
|
@@ -2418,14 +2422,14 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the xattrs of a file or directory.
|
|
|
- * Name must be prefixed with user/trusted/security/system.
|
|
|
- * Only xattrs which login user has correct permissions will be returned.
|
|
|
+ * Get all of the xattrs for a file or directory.
|
|
|
+ * Only those xattrs for which the logged-in user has permissions to view
|
|
|
+ * are returned.
|
|
|
* <p/>
|
|
|
- * A regular user only can get xattr of "user" namespace.
|
|
|
- * A super user can get xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ * A regular user can only get xattrs for the "user" namespace.
|
|
|
+ * The super user can only get xattrs for "user" and "trusted" namespaces.
|
|
|
+ * The xattr of "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
|
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
|
|
@@ -2437,7 +2441,7 @@ public final class FileContext {
|
|
|
*/
|
|
|
public Map<String, byte[]> getXAttrs(Path path, final List<String> names)
|
|
|
throws IOException {
|
|
|
- Path absF = fixRelativePart(path);
|
|
|
+ final Path absF = fixRelativePart(path);
|
|
|
return new FSLinkResolver<Map<String, byte[]>>() {
|
|
|
@Override
|
|
|
public Map<String, byte[]> next(final AbstractFileSystem fs, final Path p)
|
|
@@ -2448,13 +2452,19 @@ public final class FileContext {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Remove xattr of a file or directory.
|
|
|
- * Name must be prefixed with user/trusted/security/system.
|
|
|
+ * Remove an xattr of a file or directory.
|
|
|
+ * The name must be prefixed with user/trusted/security/system and
|
|
|
+ * followed by ".". For example, "user.attr".
|
|
|
* <p/>
|
|
|
- * A regular user only can remove xattr of "user" namespace.
|
|
|
- * A super user can remove xattr of "user" and "trusted" namespace.
|
|
|
- * XAttr of "security" and "system" namespace is only used/exposed
|
|
|
- * internally to the FS impl.
|
|
|
+ * A regular user can only remove an xattr for the "user" namespace.
|
|
|
+ * The super user can remove an xattr of either the "user" or "trusted" namespaces.
|
|
|
+ * The xattrs of the "security" and "system" namespaces are only used/exposed
|
|
|
+ * internally by/to the FS impl.
|
|
|
+ * <p/>
|
|
|
+ * The access permissions of an xattr in the "user" namespace are
|
|
|
+ * defined by the file and directory permission bits.
|
|
|
+ * An xattr can only be set when the logged-in user has the correct permissions.
|
|
|
+ * If the xattr exists, it will be replaced.
|
|
|
* <p/>
|
|
|
* @see <a href="http://en.wikipedia.org/wiki/Extended_file_attributes">
|
|
|
* http://en.wikipedia.org/wiki/Extended_file_attributes</a>
|
|
@@ -2464,7 +2474,7 @@ public final class FileContext {
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
public void removeXAttr(Path path, final String name) throws IOException {
|
|
|
- Path absF = fixRelativePart(path);
|
|
|
+ final Path absF = fixRelativePart(path);
|
|
|
new FSLinkResolver<Void>() {
|
|
|
@Override
|
|
|
public Void next(final AbstractFileSystem fs, final Path p)
|