FileStore type() method in Java with Examples Last Updated : 16 Mar, 2021 Comments Improve Suggest changes Like Article Like Report The type() method of a FileStore class is used to return the type of this file store and the format of the returned string highly implementation-specific. Syntax: public abstract String type()Parameters: This method accepts nothing. Return value: This method returns a string representing the type of this file store. Below programs illustrate the type() method: Program 1: Java // Java program to demonstrate // FileStore.type() method import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class GFG { public static void main(String[] args) { // create object of Path Path path = Paths.get("E:\\Tutorials\\file.txt"); // get FileStore object try { FileStore fs = Files.getFileStore(path); // print FileStore name // and Total usable space System.out.println("FileStore Name: " + fs.name()); String type = fs.type(); System.out.println("Type: " + type); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Output: Program 2: Java // Java program to demonstrate // FileStore.type() method import java.io.IOException; import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class GFG { public static void main(String[] args) { // create object of Path // create object of Path Path path = Paths.get("C:\\Movies\\document.txt"); // get FileStore object try { FileStore fs = Files.getFileStore(path); // print FileStore name // and Total usable space System.out.println("FileStore Name: " + fs.name()); String type = fs.type(); System.out.println("Type: " + type); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Output: References: https://docs.oracle.com/javase/10/docs/api/java/nio/file/FileStore.html#type() Comment More infoAdvertise with us Next Article FileStore type() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions java.nio.file package Java-FileStore Practice Tags : Java Similar Reads Files size() method in Java with Examples size() method of java.nio.file.Files help us to get the size of a file (in bytes). This method returns the file size, in bytes by taking the path of the file as a parameter. The size may differ from the actual size on the file system due to compression, support for sparse files, or other reasons. Th 2 min read Path getFileSystem() method in Java with Examples The Path interface was added to Java NIO in Java 7. The Path interface is located in the java.nio.file package, so the fully qualified name of the Java Path interface is java.nio.file.Path. A Java Path instance represents a path in the file system. A path can use to locate either a file or a directo 2 min read Files copy() Method in Java with Examples The copy() method of java.nio.file.Files Class is used to copy bytes from a file to I/O streams or from I/O streams to a file. I/O Stream means an input source or output destination representing different types of sources e.g. disk files. Methods: Based on the type of arguments passed, the Files cla 5 min read Field getType() method in Java with Examples The getType() method of java.lang.reflect.Field used to get the declared type of the field represented by this Field object.This method returns a Class object that identifies the declared type Syntax: public String getType() Parameters: This method accepts nothing. Return value: This method returns 2 min read Path getFileName() method in Java with Examples The Path interface was added to Java NIO in Java 7. The Path interface is located in the java.nio.file package, so the fully qualified name of the Java Path interface is java.nio.file.Path. A Java Path instance represents a path in the file system. A path can use to locate either a file or a directo 2 min read Like