Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8062955

(fs spec) Files.setLastModifiedTime should specify SecurityException more clearly

XMLWordPrintable

    • b42
    • Verified

        1. We think that there is some kind of incompleteness in return value description. Found "Returns: the path" but it seems that it's not clearly what it is the same path which we are passing in first arg. We think that it will be good if you will make description more precise.

        2. There is description of conditions in which SecurityException will be throwed:
        "SecurityException - In the case of the default provider, the security manager's checkWrite method is invoked to check write access to file".

        It sounds like "Each time checkWrite is called we get SecurityException".
        In contrast to this spec you can find j.n.f.Files.setOwner(Path, UserPrincipal) spec and description of conditions in which SecurityException will be throwed:
        "In the case of the default provider, and a security manager is installed, it denies RuntimePermission("accessUserInformation") or its checkWrite method denies write access to the file."

        And this description is much clearer.
        We think that it will be good if you will make description more precise in j.n.f.Files.setLastModifiedTime(Path, FileTime). And there is a lot of just the same unclear SecurityException specs in j.n.f.Files methods.

              alanb Alan Bateman
              asolodkaya Anastasiya Solodkaya (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: