< prev index next >

src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java

Print this page




 902      *          In the case of the default provider, and a security manager is
 903      *          installed, the {@link SecurityManager#checkRead(String) checkRead}
 904      *          method is invoked to check read access to the file, and in
 905      *          addition it checks
 906      *          {@link RuntimePermission}{@code ("getFileStoreAttributes")}
 907      */
 908     public abstract FileStore getFileStore(Path path) throws IOException;
 909 
 910     /**
 911      * Checks the existence, and optionally the accessibility, of a file.
 912      *
 913      * <p> This method may be used by the {@link Files#isReadable isReadable},
 914      * {@link Files#isWritable isWritable} and {@link Files#isExecutable
 915      * isExecutable} methods to check the accessibility of a file.
 916      *
 917      * <p> This method checks the existence of a file and that this Java virtual
 918      * machine has appropriate privileges that would allow it access the file
 919      * according to all of access modes specified in the {@code modes} parameter
 920      * as follows:
 921      *
 922      * <table border=1 cellpadding=5 summary="">


 923      * <tr> <th>Value</th> <th>Description</th> </tr>


 924      * <tr>
 925      *   <td> {@link AccessMode#READ READ} </td>
 926      *   <td> Checks that the file exists and that the Java virtual machine has
 927      *     permission to read the file. </td>
 928      * </tr>
 929      * <tr>
 930      *   <td> {@link AccessMode#WRITE WRITE} </td>
 931      *   <td> Checks that the file exists and that the Java virtual machine has
 932      *     permission to write to the file, </td>
 933      * </tr>
 934      * <tr>
 935      *   <td> {@link AccessMode#EXECUTE EXECUTE} </td>
 936      *   <td> Checks that the file exists and that the Java virtual machine has
 937      *     permission to {@link Runtime#exec execute} the file. The semantics
 938      *     may differ when checking access to a directory. For example, on UNIX
 939      *     systems, checking for {@code EXECUTE} access checks that the Java
 940      *     virtual machine has permission to search the directory in order to
 941      *     access file or subdirectories. </td>
 942      * </tr>

 943      * </table>
 944      *
 945      * <p> If the {@code modes} parameter is of length zero, then the existence
 946      * of the file is checked.
 947      *
 948      * <p> This method follows symbolic links if the file referenced by this
 949      * object is a symbolic link. Depending on the implementation, this method
 950      * may require to read file permissions, access control lists, or other
 951      * file attributes in order to check the effective access to the file. To
 952      * determine the effective access to a file may require access to several
 953      * attributes and so in some implementations this method may not be atomic
 954      * with respect to other file system operations.
 955      *
 956      * @param   path
 957      *          the path to the file to check
 958      * @param   modes
 959      *          The access modes to check; may have zero elements
 960      *
 961      * @throws  UnsupportedOperationException
 962      *          an implementation is required to support checking for




 902      *          In the case of the default provider, and a security manager is
 903      *          installed, the {@link SecurityManager#checkRead(String) checkRead}
 904      *          method is invoked to check read access to the file, and in
 905      *          addition it checks
 906      *          {@link RuntimePermission}{@code ("getFileStoreAttributes")}
 907      */
 908     public abstract FileStore getFileStore(Path path) throws IOException;
 909 
 910     /**
 911      * Checks the existence, and optionally the accessibility, of a file.
 912      *
 913      * <p> This method may be used by the {@link Files#isReadable isReadable},
 914      * {@link Files#isWritable isWritable} and {@link Files#isExecutable
 915      * isExecutable} methods to check the accessibility of a file.
 916      *
 917      * <p> This method checks the existence of a file and that this Java virtual
 918      * machine has appropriate privileges that would allow it access the file
 919      * according to all of access modes specified in the {@code modes} parameter
 920      * as follows:
 921      *
 922      * <table style="plain">
 923      * <caption style="display:none">Access Modes</caption>
 924      * <thead>
 925      * <tr> <th>Value</th> <th>Description</th> </tr>
 926      * </thead>
 927      * <tbody>
 928      * <tr>
 929      *   <td> {@link AccessMode#READ READ} </td>
 930      *   <td> Checks that the file exists and that the Java virtual machine has
 931      *     permission to read the file. </td>
 932      * </tr>
 933      * <tr>
 934      *   <td> {@link AccessMode#WRITE WRITE} </td>
 935      *   <td> Checks that the file exists and that the Java virtual machine has
 936      *     permission to write to the file, </td>
 937      * </tr>
 938      * <tr>
 939      *   <td> {@link AccessMode#EXECUTE EXECUTE} </td>
 940      *   <td> Checks that the file exists and that the Java virtual machine has
 941      *     permission to {@link Runtime#exec execute} the file. The semantics
 942      *     may differ when checking access to a directory. For example, on UNIX
 943      *     systems, checking for {@code EXECUTE} access checks that the Java
 944      *     virtual machine has permission to search the directory in order to
 945      *     access file or subdirectories. </td>
 946      * </tr>
 947      * </tbody>
 948      * </table>
 949      *
 950      * <p> If the {@code modes} parameter is of length zero, then the existence
 951      * of the file is checked.
 952      *
 953      * <p> This method follows symbolic links if the file referenced by this
 954      * object is a symbolic link. Depending on the implementation, this method
 955      * may require to read file permissions, access control lists, or other
 956      * file attributes in order to check the effective access to the file. To
 957      * determine the effective access to a file may require access to several
 958      * attributes and so in some implementations this method may not be atomic
 959      * with respect to other file system operations.
 960      *
 961      * @param   path
 962      *          the path to the file to check
 963      * @param   modes
 964      *          The access modes to check; may have zero elements
 965      *
 966      * @throws  UnsupportedOperationException
 967      *          an implementation is required to support checking for


< prev index next >