Liking cljdoc? Tell your friends :D

pathological.attributes


*file-attribute-view-factories*clj

A mapping of available file attribute view types to factory functions for materialised records.

By default, includes factories for :basic, :owner, :posix, :dos, :user and :acl file attribute views. Since the file attribute view framework is extensible and implementation dependent in Java NIO2, this var is dynamic and can be altered / rebound to support additional file attribute views.

A mapping of available file attribute view types to factory functions for
materialised records.

By default, includes factories for `:basic`, `:owner`, `:posix`, `:dos`,
`:user` and `:acl` file attribute views. Since the file attribute view
framework is extensible and implementation dependent in Java NIO2, this var is
dynamic and can be altered / rebound to support additional file attribute
views.
sourceraw docstring

->acl-file-attribute-viewclj

(->acl-file-attribute-view path view)

Converts the AclFileAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :owner: the user principal acting as owner of the file,
  • :acl: the set of ACL entries associated with the file,
  • :delegate: the underlying instance.

The :acl attribute in the returned record is a set of ACL entry maps. See pathological.utils/<-acl-entry for more details on ACL entry maps.

The returned record implements ReloadFileAttributes and UpdateFileAcl.

Converts the [AclFileAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/AclFileAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:owner`: the user principal acting as owner of the file,
  - `:acl`: the set of ACL entries associated with the file,
  - `:delegate`: the underlying instance.

The `:acl` attribute in the returned record is a set of ACL entry maps. See
[[pathological.utils/<-acl-entry]] for more details on ACL entry maps.

The returned record implements [[ReloadFileAttributes]] and
[[UpdateFileAcl]].
sourceraw docstring

->basic-file-attribute-mapclj

(->basic-file-attribute-map attributes)

Extracts all attributes from the BasicFileAttributes instance into a map.

The returned map includes:

  • :file-key: an object that uniquely identifies the file,
  • :size: the size of the file in bytes,
  • :last-modified-time: the last modified time of the file, as a string,
  • :last-access-time: the last access time of the file, as a string,
  • :creation-time: the creation time of the file, as a string,
  • :regular-file?: whether or not the file is a regular file, as a boolean,
  • :directory?: whether or not the file is a directory, as a boolean,
  • :symbolic-link?: whether or not the file is a symbolic link, as a boolean,
  • :other?: whether the file is something other than a regular file, directory or symbolic link, as a boolean.

For more details on each attribute, see the Java documentation for BasicFileAttributes.

Extracts all attributes from the
[BasicFileAttributes](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributes.html)
instance into a map.

The returned map includes:

  - `:file-key`: an object that uniquely identifies the file,
  - `:size`: the size of the file in bytes,
  - `:last-modified-time`: the last modified time of the file, as a string,
  - `:last-access-time`: the last access time of the file, as a string,
  - `:creation-time`: the creation time of the file, as a string,
  - `:regular-file?`: whether or not the file is a regular file, as a boolean,
  - `:directory?`: whether or not the file is a directory, as a boolean,
  - `:symbolic-link?`: whether or not the file is a symbolic link, as a
    boolean,
  - `:other?`: whether the file is something other than a regular file,
    directory or symbolic link, as a boolean.

For more details on each attribute, see [the Java documentation for BasicFileAttributes](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributes.html).
sourceraw docstring

->basic-file-attribute-viewclj

(->basic-file-attribute-view path view)

Converts the BasicFileAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :file-key: an object that uniquely identifies the file,
  • :size: the size of the file in bytes,
  • :last-modified-time: the last modified time of the file, as a string,
  • :last-access-time: the last access time of the file, as a string,
  • :creation-time: the creation time of the file, as a string,
  • :regular-file?: whether or not the file is a regular file, as a boolean,
  • :directory?: whether or not the file is a directory, as a boolean,
  • :symbolic-link?: whether or not the file is a symbolic link, as a boolean,
  • :other?: whether the file is something other than a regular file, directory or symbolic link, as a boolean,
  • :delegate: the underlying instance.

The returned record implements ReloadFileAttributes and UpdateFileTimes.

Converts the [BasicFileAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:file-key`: an object that uniquely identifies the file,
  - `:size`: the size of the file in bytes,
  - `:last-modified-time`: the last modified time of the file, as a string,
  - `:last-access-time`: the last access time of the file, as a string,
  - `:creation-time`: the creation time of the file, as a string,
  - `:regular-file?`: whether or not the file is a regular file, as a boolean,
  - `:directory?`: whether or not the file is a directory, as a boolean,
  - `:symbolic-link?`: whether or not the file is a symbolic link, as a
    boolean,
  - `:other?`: whether the file is something other than a regular file,
    directory or symbolic link, as a boolean,
  - `:delegate`: the underlying instance.

The returned record implements [[ReloadFileAttributes]] and
[[UpdateFileTimes]].
sourceraw docstring

->dos-file-attribute-viewclj

(->dos-file-attribute-view path view)

Converts the DosFileAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :file-key: an object that uniquely identifies the file,
  • :size: the size of the file in bytes,
  • :last-modified-time: the last modified time of the file, as a string,
  • :last-access-time: the last access time of the file, as a string,
  • :creation-time: the creation time of the file, as a string,
  • :regular-file?: whether or not the file is a regular file, as a boolean,
  • :directory?: whether or not the file is a directory, as a boolean,
  • :symbolic-link?: whether or not the file is a symbolic link, as a boolean,
  • :other?: whether the file is something other than a regular file, directory or symbolic link, as a boolean,
  • :read-only?: whether or not the file is read only, as a boolean,
  • :hidden?: whether or not the file is hidden, as a boolean,
  • :archive?: whether or not the file is an archive, as a boolean,
  • :system?: whether or not the file is a system file, as a boolean,
  • :delegate: the underlying instance.

The returned record implements ReloadFileAttributes, UpdateFileTimes and UpdateDosFileAttributes.

Converts the [DosFileAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/DosFileAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:file-key`: an object that uniquely identifies the file,
  - `:size`: the size of the file in bytes,
  - `:last-modified-time`: the last modified time of the file, as a string,
  - `:last-access-time`: the last access time of the file, as a string,
  - `:creation-time`: the creation time of the file, as a string,
  - `:regular-file?`: whether or not the file is a regular file, as a boolean,
  - `:directory?`: whether or not the file is a directory, as a boolean,
  - `:symbolic-link?`: whether or not the file is a symbolic link, as a
    boolean,
  - `:other?`: whether the file is something other than a regular file,
    directory or symbolic link, as a boolean,
  - `:read-only?`: whether or not the file is read only, as a boolean,
  - `:hidden?`: whether or not the file is hidden, as a boolean,
  - `:archive?`: whether or not the file is an archive, as a boolean,
  - `:system?`: whether or not the file is a system file, as a boolean,
  - `:delegate`: the underlying instance.

The returned record implements [[ReloadFileAttributes]], [[UpdateFileTimes]]
and [[UpdateDosFileAttributes]].
sourceraw docstring

->file-attribute-view-factoryclj

(->file-attribute-view-factory type)

Returns a file attribute view factory for building materialised records for the supplied file attribute view type when available. If no factory is available, an identity factory is returned which leaves the provided view unchanged.

See *file-attribute-view-factories* for details on supported types.

Returns a file attribute view factory for building materialised records
for the supplied file attribute view type when available. If no factory is
available, an identity factory is returned which leaves the provided view
unchanged.

See [[*file-attribute-view-factories*]] for details on supported types.
sourceraw docstring

->owner-file-attribute-viewclj

(->owner-file-attribute-view path view)

Converts the FileOwnerAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :owner: the user principal that owns the file,
  • :delegate: the underlying instance.

The returned record implements ReloadFileAttributes and UpdateFileOwner.

Converts the [FileOwnerAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/FileOwnerAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:owner`: the user principal that owns the file,
  - `:delegate`: the underlying instance.

The returned record implements [[ReloadFileAttributes]] and
[[UpdateFileOwner]].
sourceraw docstring

->posix-file-attribute-viewclj

(->posix-file-attribute-view path view)

Converts the PosixFileAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :file-key: an object that uniquely identifies the file,
  • :size: the size of the file in bytes,
  • :owner: the user principal acting as owner of the file,
  • :group: the group principal acting as group for the file,
  • :permissions: the POSIX permissions associated with the file,
  • :last-modified-time: the last modified time of the file, as a string,
  • :last-access-time: the last access time of the file, as a string,
  • :creation-time: the creation time of the file, as a string,
  • :regular-file?: whether or not the file is a regular file, as a boolean,
  • :directory?: whether or not the file is a directory, as a boolean,
  • :symbolic-link?: whether or not the file is a symbolic link, as a boolean,
  • :other?: whether the file is something other than a regular file, directory or symbolic link, as a boolean,
  • :delegate: the underlying instance.

The returned record implements ReloadFileAttributes, UpdateFileTimes, UpdateFileOwner, UpdateFileGroup and UpdatePosixFilePermissions.

Converts the [PosixFileAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFileAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:file-key`: an object that uniquely identifies the file,
  - `:size`: the size of the file in bytes,
  - `:owner`: the user principal acting as owner of the file,
  - `:group`: the group principal acting as group for the file,
  - `:permissions`: the POSIX permissions associated with the file,
  - `:last-modified-time`: the last modified time of the file, as a string,
  - `:last-access-time`: the last access time of the file, as a string,
  - `:creation-time`: the creation time of the file, as a string,
  - `:regular-file?`: whether or not the file is a regular file, as a boolean,
  - `:directory?`: whether or not the file is a directory, as a boolean,
  - `:symbolic-link?`: whether or not the file is a symbolic link, as a
    boolean,
  - `:other?`: whether the file is something other than a regular file,
    directory or symbolic link, as a boolean,
  - `:delegate`: the underlying instance.

The returned record implements [[ReloadFileAttributes]], [[UpdateFileTimes]],
[[UpdateFileOwner]], [[UpdateFileGroup]] and [[UpdatePosixFilePermissions]].
sourceraw docstring

->user-defined-file-attribute-viewclj

(->user-defined-file-attribute-view path view)

Converts the UserDefinedFileAttributeView instance to a materialised record.

The returned record includes:

  • :path: the path to the file,
  • :attributes: a map of user defined file attributes with keyword keys and byte array values,
  • :delegate: the underlying instance.

The returned record implements ReloadFileAttributes and UpdateUserDefinedFileAttributes.

Converts the [UserDefinedFileAttributeView](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/UserDefinedFileAttributeView.html)
instance to a materialised record.

The returned record includes:

  - `:path`: the path to the file,
  - `:attributes`: a map of user defined file attributes with keyword keys
    and byte array values,
  - `:delegate`: the underlying instance.

The returned record implements [[ReloadFileAttributes]] and
[[UpdateUserDefinedFileAttributes]].
sourceraw docstring

register-conversionclj

(register-conversion direction selector-spec converter)

Registers an attribute conversion to or from the specified attribute.

Takes 3 arguments:

  • A direction, one of :to or :from,
  • A selector spec, a tuple of the view and name of the attribute, as keywords,
  • A converter function of arity 1, taking the value to convert.

Either the view or the name can be the wildcard, :* matching all attribute views or names respectively. Conversions registered for attributes that already have conversions defined take precedence.

In terms of conversion precedence taking wildcards into account, the order of precedence is:

  1. Specific conversions,
  2. Wildcard name conversions,
  3. Wildcard view conversions,
  4. All wildcard conversions.
Registers an attribute conversion to or from the specified attribute.

Takes 3 arguments:

  - A direction, one of `:to` or `:from`,
  - A selector spec, a tuple of the view and name of the attribute, as
    keywords,
  - A converter function of arity 1, taking the value to convert.

Either the view or the name can be the wildcard, `:*` matching all
attribute views or names respectively. Conversions registered for attributes
that already have conversions defined take precedence.

In terms of conversion precedence taking wildcards into account, the order of
precedence is:

  1. Specific conversions,
  2. Wildcard name conversions,
  3. Wildcard view conversions,
  4. All wildcard conversions.
sourceraw docstring

ReloadFileAttributescljprotocol

A protocol allowing file attribute views to be reloaded from the backing file system.

A protocol allowing file attribute views to be reloaded from the backing
file system.

reloadclj

(reload view)

Reloads all attributes of the view.

Reloads all attributes of the view.
sourceraw docstring

UpdateDosFileAttributescljprotocol

A protocol allowing DOS file attributes to be updated.

For more details see the Java documentation.

A protocol allowing DOS file attributes to be updated.

For more details see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/DosFileAttributeView.html).

set-archiveclj

(set-archive view value)

Sets the archive attribute on the path to which the view corresponds to the boolean value.

Sets the archive attribute on the path to which the view corresponds to
the boolean value.

set-hiddenclj

(set-hidden view value)

Sets the hidden attribute on the path to which the view corresponds to the boolean value.

Sets the hidden attribute on the path to which the view corresponds to
the boolean value.

set-read-onlyclj

(set-read-only view value)

Sets the read-only attribute on the path to which the view corresponds to the boolean value.

Sets the read-only attribute on the path to which the view corresponds to
the boolean value.

set-systemclj

(set-system view value)

Sets the system attribute on the path to which the view corresponds to the boolean value.

Sets the system attribute on the path to which the view corresponds to
the boolean value.
sourceraw docstring

UpdateFileAclcljprotocol

A protocol allowing the access control list (ACL) of a file to be updated.

For more details see the Java documentation.

A protocol allowing the access control list (ACL) of a file to be updated.

For more details see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/AclFileAttributeView.html#setAcl%28java.util.List%29).

set-aclclj

(set-acl view acl-entries)

Sets the ACL of the path to which the view corresponds to the set of ACL entries.

Each ACL entry should be an ACL entry map. See pathological.utils/->acl-entry for more details on permissible values.

Sets the ACL of the path to which the view corresponds to the set of ACL
entries.

Each ACL entry should be an ACL entry map. See
[[pathological.utils/->acl-entry]] for more details on permissible
values.
sourceraw docstring

UpdateFileGroupcljprotocol

A protocol allowing file groups to be updated.

For more details, see the Java documentation.

A protocol allowing file groups to be updated.

For more details, see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFileAttributeView.html#setGroup%28java.nio.file.attribute.GroupPrincipal%29).

set-groupclj

(set-group view group)

Sets the group on the path to which the view corresponds.

The group argument must implement GroupPrincipal. To aid in constructing such an instance, see pathological.principals/->group-principal.

Sets the group on the path to which the view corresponds.

The group argument must implement
[GroupPrincipal](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/GroupPrincipal.html).
To aid in constructing such an instance, see
[[pathological.principals/->group-principal]].
sourceraw docstring

UpdateFileOwnercljprotocol

A protocol allowing file owners to be updated.

For more details, see the Java documentation.

A protocol allowing file owners to be updated.

For more details, see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/FileOwnerAttributeView.html#setOwner%28java.nio.file.attribute.UserPrincipal%29).

set-ownerclj

(set-owner view owner)

Sets the owner on the path to which the view corresponds.

The owner argument must implement UserPrincipal. To aid in constructing such an instance, see pathological.principals/->user-principal.

Sets the owner on the path to which the view corresponds.

The owner argument must implement
[UserPrincipal](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/UserPrincipal.html).
To aid in constructing such an instance, see
[[pathological.principals/->user-principal]].
sourceraw docstring

UpdateFileTimescljprotocol

A protocol allowing file times to be updated individually or all at once.

In each case, the time argument(s) should be strings or FileTime instances. To aid in constructing times, see pathological.utils/->file-time.

For more details, see the Java documentation.

A protocol allowing file times to be updated individually or all at once.

In each case, the time argument(s) should be strings or
[FileTime](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/FileTime.html)
instances. To aid in constructing times, see
[[pathological.utils/->file-time]].

For more details, see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributeView.html#setTimes%28java.nio.file.attribute.FileTime%2C%20java.nio.file.attribute.FileTime%2C%20java.nio.file.attribute.FileTime%29).

set-creation-timeclj

(set-creation-time view creation-time)

Sets the creation time on the path to which the view corresponds. If the time is nil, it should be left unmodified.

Sets the creation time on the path to which the view corresponds.
If the time is `nil`, it should be left unmodified.

set-last-access-timeclj

(set-last-access-time view last-access-time)

Sets the last access time on the path to which the view corresponds. If the time is nil, it should be left unmodified.

Sets the last access time on the path to which the view corresponds.
If the time is `nil`, it should be left unmodified.

set-last-modified-timeclj

(set-last-modified-time view last-modified-time)

Sets the last modified time on the path to which the view corresponds. If the time is nil, it should be left unmodified.

Sets the last modified time on the path to which the view corresponds.
If the time is `nil`, it should be left unmodified.

set-timesclj

(set-times view last-modified-time last-access-time creation-time)

Sets the last modified, last access and creation times on the path to which the view corresponds. If any time is nil, it should be left unmodified.

Sets the last modified, last access and creation times on the path to which
the view corresponds. If any time is `nil`, it should be left unmodified.
sourceraw docstring

UpdatePosixFilePermissionscljprotocol

A protocol allowing file permissions to be updated.

For more details see the Java documentation.

A protocol allowing file permissions to be updated.

For more details see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFileAttributeView.html#setPermissions%28java.util.Set%29).

set-permissionsclj

(set-permissions view permissions)

Sets the permissions on the path to which the view corresponds.

The permissions argument should be a permission string or permission set. See pathological.utils/->posix-file-permissions for more details on permissible values.

Sets the permissions on the path to which the view corresponds.

The permissions argument should be a permission string or permission set.
See [[pathological.utils/->posix-file-permissions]] for more details on
permissible values.
sourceraw docstring

UpdateUserDefinedFileAttributescljprotocol

A protocol allowing user defined file attributes to be updated.

For more details see the Java documentation.

A protocol allowing user defined file attributes to be updated.

For more details see [the Java documentation](https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/UserDefinedFileAttributeView.html).

delete-attributeclj

(delete-attribute view name)

Deletes the user defined attribute with the given name from the path to which the view corresponds.

Deletes the user defined attribute with the given name from the path to
which the view corresponds.

write-attributeclj

(write-attribute view name value)

Writes the user defined attribute with the given name to the value on the path to which the view corresponds.

The attribute value can be a string, an array of bytes or a byte buffer. See pathological.utils/->byte-buffer for more details on permissible values.

Writes the user defined attribute with the given name to the value on the
path to which the view corresponds.

The attribute value can be a string, an array of bytes or a byte buffer.
See [[pathological.utils/->byte-buffer]] for more details on permissible
values.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close