Package org.jnode.fs
Interface FileSystem<T extends FSEntry>
-
- Type Parameters:
T
-FSEntry
sub-type
- All Known Implementing Classes:
AbstractFileSystem
,ApfsFileSystem
,ExFatFileSystem
,Ext2FileSystem
,FatFileSystem
,FatFileSystem
,HfsPlusFileSystem
,ISO9660FileSystem
,NTFSFileSystem
,XfsFileSystem
public interface FileSystem<T extends FSEntry>
The FileSystem interface provide methods common to file system implementations. *- Author:
- epr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close this file system.Device
getDevice()
Gets the device this FS driver operates on.long
getFreeSpace()
The total free space in bytes of this file system.T
getRootEntry()
Gets the root entry of this filesystem.long
getTotalSpace()
Return The total size in bytes of this file system.FileSystemType<? extends FileSystem<T>>
getType()
Return type of the file system.long
getUsableSpace()
The usable space of this file system.String
getVolumeName()
Gets the volume name for this file system.boolean
isClosed()
Returns true if this file system is close.boolean
isReadOnly()
Returns true if the file system is mounted in read-only mode.
-
-
-
Method Detail
-
getType
FileSystemType<? extends FileSystem<T>> getType()
Return type of the file system.- Returns:
FileSystemType
corresponding to this file system
-
getDevice
Device getDevice()
Gets the device this FS driver operates on.- Returns:
Device
contains this file system.
-
getRootEntry
T getRootEntry() throws IOException
Gets the root entry of this filesystem. This is usually a directory, but this is not required.- Returns:
FSEntry
corresponding to root entry.- Throws:
IOException
- if an I/O error occurs
-
isReadOnly
boolean isReadOnly()
Returns true if the file system is mounted in read-only mode.- Returns:
- true if it's a read-only file system.
-
close
void close() throws IOException
Close this file system. After a close, all invocations of method of this file system or objects created by this file system will throw an IOException.- Throws:
IOException
- if an I/O error occurs
-
isClosed
boolean isClosed()
Returns true if this file system is close.- Returns:
- true if file system is closed.
-
getTotalSpace
long getTotalSpace() throws IOException
Return The total size in bytes of this file system.- Returns:
- total size in bytes or -1 if this feature is unsupported.
- Throws:
IOException
- if an I/O error occurs
-
getFreeSpace
long getFreeSpace() throws IOException
The total free space in bytes of this file system.- Returns:
- total free space in bytes or -1 if this feature is unsupported
- Throws:
IOException
- if an I/O error occurs
-
getUsableSpace
long getUsableSpace() throws IOException
The usable space of this file system.- Returns:
- usable space in bytes or -1 if this feature is unsupported
- Throws:
IOException
- if an I/O error occurs
-
getVolumeName
String getVolumeName() throws IOException
Gets the volume name for this file system.- Returns:
- the volume name.
- Throws:
IOException
- if an error occurs reading the volume name.
-
-