public final class FileAttribute
extends java.lang.Object
Uses C Library __chattr() and stat() APIs.
For more information, refer to the __chattr() and stat()
library functions in "z/OS XL C/C++ Run-Time Library Reference, SA22-7821".
Or to the chattr and stat assembler services in "z/OS UNIX
System Services Programming: Assembler Callable Services Reference,
SA23-2281-00".
| Modifier and Type | Class and Description |
|---|---|
static class |
FileAttribute.Stat
Contains USS file attribute values.
|
static class |
FileAttribute.Tag
Represents a USS file tag.
|
| Modifier and Type | Method and Description |
|---|---|
static FileAttribute.Stat |
getStat(java.lang.String pathname)
Retrieve file attributes associated with the given USS file.
|
static void |
setApfAuthorized(java.lang.String pathname,
boolean value)
Given a USS file with the specified
pathname, set its
APF authorized extended attribute. |
static void |
setAuditorAuditInfo(java.lang.String pathname,
int info)
Given a USS file with the specified
pathname, set its
auditor audit flags. |
static void |
setChangeTime(java.lang.String pathname)
Given a USS file with the specified
pathname, set its
change time attribute to the current time. |
static void |
setChangeTime(java.lang.String pathname,
java.nio.file.attribute.FileTime time)
Given a USS file with the specified
pathname, set its
change time attribute. |
static void |
setFormat(java.lang.String pathname,
byte format)
Given a USS file with the specified
pathname, set its
file format. |
static void |
setNoShareas(java.lang.String pathname,
boolean value)
Given a USS file with the specified
pathname, set its
no shareas extended attribute. |
static void |
setProgramControlled(java.lang.String pathname,
boolean value)
Given a USS file with the specified
pathname, set its
program controlled extended attribute. |
static void |
setSecurityLabel(java.lang.String pathname,
java.lang.String label)
Given a USS file with the specified
pathname, set its
security label. |
static void |
setSharedLibrary(java.lang.String pathname,
boolean value)
Given a USS file with the specified
pathname, set its
shared library extended attribute. |
static void |
setTag(java.lang.String pathname,
FileAttribute.Tag tag)
Given a USS file with the specified
pathname, set its
file tag. |
static void |
setUserAuditInfo(java.lang.String pathname,
int info)
Given a USS file with the specified
pathname, set its
user audit flags. |
public static void setSharedLibrary(java.lang.String pathname,
boolean value)
pathname, set its
shared library extended attribute.
For more information on setting the shared library attribute, refer to the section titled "Defining UNIX files as shared library programs" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedvalue - the shared library extended attribute value to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setNoShareas(java.lang.String pathname,
boolean value)
pathname, set its
no shareas extended attribute.
For more information on extended attributes for files, refer to the "z/OS UNIX System Services Command Reference, SA22-7802".
pathname - full path of the USS file on which attribute value
will be changedvalue - the no shareas extended attribute value to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setApfAuthorized(java.lang.String pathname,
boolean value)
pathname, set its
APF authorized extended attribute.
For more information on setting the APF authorized attribute, refer to the section titled "Defining UNIX files as APF-authorized programs" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedvalue - the APF authorized extended attribute value to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setProgramControlled(java.lang.String pathname,
boolean value)
pathname, set its
program controlled extended attribute.
For more information on setting the program controlled attribute, refer to the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedvalue - the program controlled extended attribute value to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setAuditorAuditInfo(java.lang.String pathname,
int info)
pathname, set its
auditor audit flags. Audit attributes determine whether or not accesses
to a file are audited by the system authorization facility (SAF)
interface.
For more information on specifying file audit options, refer to the section titled "Auditing access to files and directories" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedinfo - the auditor audit flags to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setUserAuditInfo(java.lang.String pathname,
int info)
pathname, set its
user audit flags. Audit attributes determine whether or not accesses
to a file are audited by the system authorization facility (SAF)
interface.
For more information on specifying file audit options, refer to the section titled "Auditing access to files and directories" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedinfo - the user audit flags to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setChangeTime(java.lang.String pathname)
pathname, set its
change time attribute to the current time.pathname - full path of the USS file on which attribute value
will be changedjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setChangeTime(java.lang.String pathname,
java.nio.file.attribute.FileTime time)
pathname, set its
change time attribute. Use 64-bit JVM for setting time values beyond
year 2038.pathname - full path of the USS file on which attribute value
will be changedtime - the change time value to set, if null, will set the change
time to the current timejava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.java.lang.IllegalArgumentException - if the time value is prior to 1970, or
if the time value is beyond 2038 and running 31-bit JVM.public static void setFormat(java.lang.String pathname,
byte format)
pathname, set its
file format.
For more information on specifying format of the file, refer to the "chattr" syscall command description in the reference "z/OS Using REXX and z/OS UNIX System Services, SA22-7806".
pathname - full path of the USS file on which attribute value
will be changedformat - the file format to setjava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setTag(java.lang.String pathname,
FileAttribute.Tag tag)
pathname, set its
file tag.
For more information on tagging of files, refer to the section titled "Converting files between code pages" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedtag - the file tag to setjava.lang.NullPointerException - if pathname or tag is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.public static void setSecurityLabel(java.lang.String pathname,
java.lang.String label)
pathname, set its
security label.
For more information on security labels, refer to the section titled "Using security labels" in the reference "z/OS UNIX System Services Planning, GA22-7800".
pathname - full path of the USS file on which attribute value
will be changedlabel - the security label to set, cannot be more than 8
characters. If less than 8 characters, the label will be padded on the
right with blanksjava.lang.NullPointerException - if pathname or label
is null.ErrnoException - if the underlying __chattr() call was
unsuccessful.java.lang.IllegalArgumentException - if the specified label is
more than 8 characters long.public static FileAttribute.Stat getStat(java.lang.String pathname)
pathname - full path of the USS filejava.lang.NullPointerException - if pathname is null.ErrnoException - if the underlying stat() call was unsuccessful.