Interface FileNotFoundAction

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface FileNotFoundAction
    Defines the action to perform when the file is not found.
    • Method Detail

      • run

        boolean run​(java.nio.file.Path file,
                    ConfigFormat<?> configFormat)
             throws java.io.IOException
        Performs the action.
        Returns:
        true to parse the file, false to stop after the action's execution (thus making the config empty)
        Throws:
        java.io.IOException - if an IO error occurs
      • copyData

        static FileNotFoundAction copyData​(java.net.URL url)
        Action: copies the data at the given url.
        Parameters:
        url - the data url
        Returns:
        a FileNotFoundAction that copies the url's data if the file is not found
      • copyData

        static FileNotFoundAction copyData​(java.io.File file)
        Action: copies the specified file.
        Parameters:
        file - the data url
        Returns:
        a FileNotFoundAction that copies the file's data if the file is not found
      • copyData

        static FileNotFoundAction copyData​(java.nio.file.Path file)
        Action: copies the specified file.
        Parameters:
        file - the data url
        Returns:
        a FileNotFoundAction that copies the file's data if the file is not found
      • copyData

        static FileNotFoundAction copyData​(java.io.InputStream data)
        Action: copies the stream's data.
        Parameters:
        data - the stream containing the data
        Returns:
        a FileNotFoundAction that copies the stream's data if the file is not found
      • copyResource

        static FileNotFoundAction copyResource​(java.lang.String resourcePath)
        Action: copies the inner resource.
        Parameters:
        resourcePath - the resource's path
        Returns:
        a FileNotFoundAction that copies the url's data if the file is not found
        See Also:
        Class.getResource(String)