Package net.groboclown.retval.problems
Class FileProblem
- java.lang.Object
-
- net.groboclown.retval.problems.FileProblem
-
- All Implemented Interfaces:
Problem,SourcedProblem
@Immutable public class FileProblem extends java.lang.Object implements SourcedProblem
A problem that comes from a known file.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileProblemfrom(java.io.File file, java.io.IOException ex)Create a file problem from a file object and an I/O exception.static FileProblemfrom(java.lang.String source, java.io.IOException ex)Create a file problem from a file object and an I/O exception.static FileProblemfrom(java.lang.String filePath, java.lang.String localMessage)Create the file problem from the file path and message.java.lang.StringgetSource()A single source of the problem.java.lang.StringlocalMessage()A human-consumable message describing the problem.java.lang.StringtoString()
-
-
-
Method Detail
-
from
@Nonnull public static FileProblem from(@Nonnull java.lang.String filePath, @Nonnull java.lang.String localMessage)
Create the file problem from the file path and message.- Parameters:
filePath- path to the source that caused the problem. In some cases, this may be something other than a file, such as a URI.localMessage- informative user message about the problem.- Returns:
- the problem instance.
-
from
@Nonnull public static FileProblem from(@Nonnull java.io.File file, @Nonnull java.io.IOException ex)
Create a file problem from a file object and an I/O exception.- Parameters:
file- source fileex- exception generated from the operation.- Returns:
- the file problem object.
-
from
@Nonnull public static FileProblem from(@Nonnull java.lang.String source, @Nonnull java.io.IOException ex)
Create a file problem from a file object and an I/O exception.- Parameters:
source- source of the problemex- exception generated from the operation.- Returns:
- the file problem object.
-
localMessage
@Nonnull public java.lang.String localMessage()
Description copied from interface:ProblemA human-consumable message describing the problem.- Specified by:
localMessagein interfaceProblem- Returns:
- the message, localized for the end-user.
-
getSource
@Nonnull public java.lang.String getSource()
Description copied from interface:SourcedProblemA single source of the problem.- Specified by:
getSourcein interfaceSourcedProblem- Returns:
- the source of the problem.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-