de.waldheinz.fs
Interface FileSystem

All Known Implementing Classes:
AbstractFileSystem, FatFileSystem

public interface FileSystem

The interface common to all file system implementations.

Author:
Ewout Prangsma <epr at jnode.org>, Matthias Treydte <waldheinz at gmail.com>

Method Summary
 void close()
          Close this file system.
 void flush()
          Flushes any modified file system structures to the underlying storage.
 long getFreeSpace()
          The free space of this file system.
 FsDirectory getRoot()
          Gets the root entry of this filesystem.
 long getTotalSpace()
          The total size of this file system.
 long getUsableSpace()
          The usable space of this file system.
 boolean isClosed()
          Returns true if this file system is closed.
 boolean isReadOnly()
          Returns if this FileSystem is in read-only mode.
 

Method Detail

getRoot

FsDirectory getRoot()
                    throws IOException
Gets the root entry of this filesystem. This is usually a directory, but this is not required.

Returns:
the file system's root entry
Throws:
IOException - on read error

isReadOnly

boolean isReadOnly()
Returns if this FileSystem is in read-only mode.

Returns:
if this FileSystem is read-only

close

void close()
           throws IOException
Close this file system. After a close, all invocations of methods of this file system or objects created by this file system will throw an IllegalStateException.

Throws:
IOException - on error closing the file system

isClosed

boolean isClosed()
Returns true if this file system is closed. If the file system is closed, no more operations may be performed on it.

Returns:
if this file system is closed

getTotalSpace

long getTotalSpace()
                   throws IOException
The total size of this file system.

Returns:
if -1 this feature is unsupported
Throws:
IOException - if an I/O error occurs

getFreeSpace

long getFreeSpace()
                  throws IOException
The free space of this file system.

Returns:
if -1 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:
if -1 this feature is unsupported
Throws:
IOException - if an I/O error occurs

flush

void flush()
           throws IOException
Flushes any modified file system structures to the underlying storage.

Throws:
IOException


Copyright © 2014. All rights reserved.