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".
- Since:
- 2.4.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains USS file attribute values.static final classRepresents a USS file tag. -
Method Summary
Modifier and TypeMethodDescriptionstatic FileAttribute.StatRetrieve file attributes associated with the given USS file.static voidsetApfAuthorized(String pathname, boolean value) Given a USS file with the specifiedpathname, set its APF authorized extended attribute.static voidsetAuditorAuditInfo(String pathname, int info) Given a USS file with the specifiedpathname, set its auditor audit flags.static voidsetChangeTime(String pathname) Given a USS file with the specifiedpathname, set its change time attribute to the current time.static voidsetChangeTime(String pathname, FileTime time) Given a USS file with the specifiedpathname, set its change time attribute.static voidGiven a USS file with the specifiedpathname, set its fileformat.static voidsetNoShareas(String pathname, boolean value) Given a USS file with the specifiedpathname, set its no shareas extended attribute.static voidsetProgramControlled(String pathname, boolean value) Given a USS file with the specifiedpathname, set its program controlled extended attribute.static voidsetSecurityLabel(String pathname, String label) Given a USS file with the specifiedpathname, set its securitylabel.static voidsetSharedLibrary(String pathname, boolean value) Given a USS file with the specifiedpathname, set its shared library extended attribute.static voidsetTag(String pathname, FileAttribute.Tag tag) Given a USS file with the specifiedpathname, set its filetag.static voidsetUserAuditInfo(String pathname, int info) Given a USS file with the specifiedpathname, set its user audit flags.
-
Method Details
-
setApfAuthorized
Given a USS file with the specifiedpathname, 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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedvalue- the APF authorized extended attribute value to set- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setProgramControlled
Given a USS file with the specifiedpathname, 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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedvalue- the program controlled extended attribute value to set- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setAuditorAuditInfo
Given a USS file with the specifiedpathname, 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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedinfo- the auditor audit flags to set- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setUserAuditInfo
Given a USS file with the specifiedpathname, 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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedinfo- the user audit flags to set- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setChangeTime
Given a USS file with the specifiedpathname, set its change time attribute to the current time.- Parameters:
pathname- full path of the USS file on which attribute value will be changed- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setChangeTime
Given a USS file with the specifiedpathname, set its change time attribute. Use 64-bit JVM for setting time values beyond year 2038.- Parameters:
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 time- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.IllegalArgumentException- if the time value is prior to 1970, or if the time value is beyond 2038 and running 31-bit JVM.
-
setFormat
Given a USS file with the specifiedpathname, set its fileformat.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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedformat- the file format to set- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setTag
Given a USS file with the specifiedpathname, set its filetag.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".
- Parameters:
pathname- full path of the USS file on which attribute value will be changedtag- the file tag to set- Throws:
NullPointerException- ifpathnameortagis null.ErrnoException- if the underlying__chattr()call was unsuccessful.
-
setSecurityLabel
Given a USS file with the specifiedpathname, set its securitylabel.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".
- Parameters:
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 blanks- Throws:
NullPointerException- ifpathnameorlabelis null.ErrnoException- if the underlying__chattr()call was unsuccessful.IllegalArgumentException- if the specifiedlabelis more than 8 characters long.
-
getStat
Retrieve file attributes associated with the given USS file.- Parameters:
pathname- full path of the USS file- Returns:
- file attributes associated with the given USS file.
- Throws:
NullPointerException- ifpathnameis null.ErrnoException- if the underlying stat() call was unsuccessful.