Class InputOutputContextSubdirectoryCache

Object
InputOutputContextSubdirectoryCache

public class InputOutputContextSubdirectoryCache extends Object
Caches a InputOutputContext for each subdirectory as they are created.

This allows reusage of an existing InputOutputContext in other outputters without creating any potential clashes.

TODO is this still needed without manifests?

Author:
Owen Feehan
  • Constructor Details

    • InputOutputContextSubdirectoryCache

      public InputOutputContextSubdirectoryCache(InputOutputContext parentContext, boolean inheritOutputRulesAndRecording)
      Creates a new InputOutputContextSubdirectoryCache instance.
      Parameters:
      parentContext - the context of the directory in which subdirectories may be created
      inheritOutputRulesAndRecording - If true, the output rules and recording are inherited from the parent directory. if false, they are not, and all outputs are allowed and are unrecorded.
  • Method Details

    • get

      public InputOutputContext get(Optional<String> subdirectoryName)
      Gets (from the cache if it's already there) a context for a subdirectory of given-name
      Parameters:
      subdirectoryName - the subdirectory name. if not set, then the parentContext is returned instead.
      Returns:
      either an existing context for the subdirectory or a newly created one