Class RootAndGlob

java.lang.Object
com.azure.tools.codesnippetplugin.RootAndGlob

public final class RootAndGlob extends Object
Contains a search root and file glob that is used to determine which files to include in processing.
  • Constructor Details

    • RootAndGlob

      public RootAndGlob()
      Creates a new RootAndGlob.
  • Method Details

    • getRoot

      public File getRoot()
      Gets the root directory to begin searching.
      Returns:
      The root directory where searching begins.
    • setRoot

      public RootAndGlob setRoot(File root)
      Sets the root directory to begin searching.
      Parameters:
      root - The root directory where searching begins.
      Returns:
      The updated RootAndGlob object.
      Throws:
      NullPointerException - If root is null.
    • rootExists

      public boolean rootExists()
      Gets whether the root directory exists.
      Returns:
      Whether the root directory exists.
    • getGlob

      public String getGlob()
      Gets the glob that determines which files to include.
      Returns:
      The glob that determines which files to include.
    • setGlob

      public RootAndGlob setGlob(String glob)
      Sets the glob that determines which files to include.
      Parameters:
      glob - The glob that determines which files to include.
      Returns:
      The updated RootAndGlob object.
      Throws:
      NullPointerException - If glob is null.
    • globFiles

      public List<Path> globFiles() throws IOException
      Gets the list of files that are included based on the root and glob.
      Returns:
      The list of files contained in the root directory that match the glob.
      Throws:
      IOException - If an I/O failure occurs while walking the root directory.