Interface FileSystem

All Known Implementing Classes:
DefaultFileSystem, FolderFileSystem, ResourceFileSystem, ZipFileSystem

public interface FileSystem
Represents a simple file system, where each file is associated to a unique name.
  • Method Summary

    Modifier and Type
    Method
    Description
    read(String name)
    Open an existing file for read.
    write(String name)
    Open file for write, previous content overwritten if any.
  • Method Details

    • read

      InputStream read(String name) throws IOException
      Open an existing file for read.
      Parameters:
      name - (String): unique identifier, not null
      Returns:
      (InputStream): content stream, not null
      Throws:
      IOException - if file cannot be open for read
    • write

      OutputStream write(String name) throws IOException
      Open file for write, previous content overwritten if any.
      Parameters:
      name - (String): unique identifier, not null
      Returns:
      (InputStream): content stream, not null
      Throws:
      IOException - if file cannot be open for write