java.nio.file.attribute

Interface FileOwnerAttributeView

  • All Superinterfaces:
    AttributeView, FileAttributeView
    All Known Subinterfaces:
    AclFileAttributeView, PosixFileAttributeView

    public interface FileOwnerAttributeView
    extends FileAttributeView
    A file attribute view that supports reading or updating the owner of a file. This file attribute view is intended for file system implementations that support a file attribute that represents an identity that is the owner of the file. Often the owner of a file is the identity of the entity that created the file.

    The getOwner or setOwner methods may be used to read or update the owner of the file.

    The getAttribute and setAttribute methods may also be used to read or update the owner. In that case, the owner attribute is identified by the name "owner", and the value of the attribute is a UserPrincipal.

    Since:
    1.7
    • Method Detail

      • name

        String name()
        Returns the name of the attribute view. Attribute views of this type have the name "owner".
        Specified by:
        name in interface AttributeView
      • setOwner

        void setOwner(UserPrincipal owner)
                      throws IOException
        Updates the file owner.

        It it implementation specific if the file owner can be a group. To ensure consistent and correct behavior across platforms it is recommended that this method should only be used to set the file owner to a user principal that is not a group.

        Parameters:
        owner - the new file owner
        Throws:
        IOException - if an I/O error occurs, or the owner parameter is a group and this implementation does not support setting the owner to a group
        SecurityException - In the case of the default provider, a security manager is installed, and it denies RuntimePermission("accessUserInformation") or its checkWrite method denies write access to the file.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-java/nio/file/attribute/FileOwnerAttributeView.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut