Package jenkins.util.io
Class CompositeIOException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- jenkins.util.io.CompositeIOException
-
- All Implemented Interfaces:
Serializable
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class CompositeIOException extends IOException
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intEXCEPTION_LIMITThe maximum number of exceptions that can be reported by a singleCompositeIOException.
-
Constructor Summary
Constructors Constructor Description CompositeIOException(String message, IOException... exceptions)CompositeIOException(String message, List<IOException> exceptions)Construct a newCompositeIOExceptionwhere the given list of exceptions are added as suppressed exceptions to the new exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UncheckedIOExceptionasUncheckedIOException()List<IOException>getExceptions()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
EXCEPTION_LIMIT
public static final int EXCEPTION_LIMIT
The maximum number of exceptions that can be reported by a singleCompositeIOException.The number of exceptions is limited to avoid pathological cases where a huge number of exceptions could lead to excessive memory usage. For example, if the number of exceptions was unlimited, a call to
Util.deleteRecursivecould fail with aCompositeIOExceptionthat contains an exception for every single file inside of the directory.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CompositeIOException
public CompositeIOException(String message, @NonNull List<IOException> exceptions)
Construct a newCompositeIOExceptionwhere the given list of exceptions are added as suppressed exceptions to the new exception.If the given list of exceptions is longer than
EXCEPTION_LIMIT, the list will be truncated to that length, and a message indicating the number of discarded exceptions will be appended to the original message.
-
CompositeIOException
public CompositeIOException(String message, IOException... exceptions)
- See Also:
CompositeIOException(String, List)
-
-
Method Detail
-
getExceptions
public List<IOException> getExceptions()
-
asUncheckedIOException
public UncheckedIOException asUncheckedIOException()
-
-