getFileStore() method of java.nio.file.Files help us to return the FileStore object which represents the file store where a file is located. Once you get a reference to the FileStore you can apply fileStrore type of operation to get information of filestore.
public static FileStore getFileStore(Path path) throws IOException
Parameters: This method accepts a parameter path which is the path to the file to get FileStore.
Return value: This method returns the file store where the file is stored.
Exception: This method will throw following exceptions:
- IOException: if an I/O error occurs
- SecurityException: In the case of the default provider, and a security manager is installed, the SecurityManager.checkgetFileStore(String) method is invoked to check to getFileStore access to the file
Below programs illustrate getFileStore(Path) method:
- Files isExecutable() method in Java with Examples
- Files isHidden() method in Java with Examples
- Files isReadable() method in Java with Examples
- Files isWritable() method in Java with Examples
- Files size() method in Java with Examples
- Files delete() method in Java with Examples
- Files deleteIfExists() method in Java with Examples
- Jar files in Java
- Compressing and Decompressing files in Java
- Working with JAR and Manifest files In Java
- How to rename all files of a folder using Java?
- Java program to merge two files into a third file
- Java program to merge contents of all the files in a directory
- Java program to merge two files alternatively into third file
- Compressing and Decompressing files using GZIP Format in java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.