Interface IAbstractFileSystem

  • All Known Implementing Classes:
    FileSystemImpl

    public interface IAbstractFileSystem
    A very basic abstraction of what a component storage does (whether local or remote) as far as a component repository is concerned.

    Implementations of this interface serve to hold components and component resources organized in a folder style structure where the root level contains modules (or projects) and the second level contains component folders containing a properties file resource z.properties or direct component definitions in the form of .properties file resources.

    File resources are provided via instances of AbstractFile.

    All names for files are absolute. Paths do not start with "/" but paths are separated by "/". The root folder is hence named "", rather than "/"

    Author:
    hb
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean exists​(java.lang.String name)
      Check whether a file exists.
      java.io.InputStream getInputStream​(java.lang.String name)
      Retrieve the named resource as InputStream
      java.io.File getRoot()
      Returns the root folder
      java.util.Iterator<AbstractFile> iterate​(java.lang.String name, int depth)
      Iterate over files under another file, i.e.
      java.util.List<AbstractFile> list​(java.lang.String name, int depth)
      list files under another file, i.e.
    • Method Detail

      • getRoot

        java.io.File getRoot()
        Returns the root folder
        Returns:
        Root folder
      • exists

        boolean exists​(java.lang.String name)
                throws java.io.IOException
        Check whether a file exists.
        Parameters:
        name -
        Returns:
        true if the named file exists, false otherwise.
        Throws:
        java.io.IOException
      • getInputStream

        java.io.InputStream getInputStream​(java.lang.String name)
                                    throws java.io.IOException
        Retrieve the named resource as InputStream
        Throws:
        java.io.IOException
      • list

        java.util.List<AbstractFile> list​(java.lang.String name,
                                          int depth)
                                   throws java.io.IOException
        list files under another file, i.e. a folder. The first result element is the named file as specified by the signature.
        Throws:
        java.io.IOException
      • iterate

        java.util.Iterator<AbstractFile> iterate​(java.lang.String name,
                                                 int depth)
                                          throws java.io.IOException
        Iterate over files under another file, i.e. a folder. The first result element is the named file as specified by the signature. When working over large sets of files this method should realize the advantage that it does not require to read everything in advance, saving memory and time.
        Throws:
        java.io.IOException