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 FileNotFoundActionDefines the action to perform when the file is not found.
-
-
Field Summary
Fields Modifier and Type Field Description static FileNotFoundActionCREATE_EMPTYstatic FileNotFoundActionREAD_NOTHINGstatic FileNotFoundActionTHROW_ERROR
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static FileNotFoundActioncopyData(java.io.File file)Action: copies the specified file.static FileNotFoundActioncopyData(java.io.InputStream data)Action: copies the stream's data.static FileNotFoundActioncopyData(java.net.URL url)Action: copies the data at the given url.static FileNotFoundActioncopyData(java.nio.file.Path file)Action: copies the specified file.static FileNotFoundActioncopyResource(java.lang.String resourcePath)Action: copies the inner resource.booleanrun(java.nio.file.Path file, ConfigFormat<?> configFormat)Performs the action.
-
-
-
Field Detail
-
CREATE_EMPTY
static final FileNotFoundAction CREATE_EMPTY
-
READ_NOTHING
static final FileNotFoundAction READ_NOTHING
-
THROW_ERROR
static final FileNotFoundAction THROW_ERROR
-
-
Method Detail
-
run
boolean run(java.nio.file.Path file, ConfigFormat<?> configFormat) throws java.io.IOExceptionPerforms the action.- Returns:
trueto parse the file,falseto 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)
-
-