Class FtDefault

  • All Implemented Interfaces:
    Footprint

    public final class FtDefault
    extends Object
    implements Footprint
    Default implementation of a Footprint. Program footprint of EO compilation process.

    The footprint consists of file in main folder

    Since:
    1.0
    • Constructor Detail

      • FtDefault

        public FtDefault​(Path path)
        Ctor.
        Parameters:
        path - Main location.
    • Method Detail

      • load

        public String load​(String program,
                           String ext)
                    throws IOException
        Description copied from interface: Footprint
        Get program content of a specific type.

        That is, if the file contains "hello", it will return the string "hello".

        Specified by:
        load in interface Footprint
        Parameters:
        program - Program name
        ext - File extension which defines the type
        Returns:
        Content of a file
        Throws:
        IOException - In case of IO issue.
      • save

        public void save​(String program,
                         String ext,
                         org.cactoos.Scalar<String> content)
                  throws IOException
        Description copied from interface: Footprint
        Save content.

        Leaves a "footprint" in the directory. So it can create a new file in the file system. Where it will create this file depends on the implementation.

        Specified by:
        save in interface Footprint
        Parameters:
        program - Program name
        ext - File extension
        content - File content
        Throws:
        IOException - In case of IO issues
      • list

        public List<Path> list​(String ext)
                        throws IOException
        Get list of saved regular files with ext.
        Specified by:
        list in interface Footprint
        Parameters:
        ext - File extension
        Returns:
        List of files
        Throws:
        IOException - In case of IO issues