public class FetchException
extends java.lang.Exception
implements java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
FetchException.FetchExceptionMode |
Modifier and Type | Field and Description |
---|---|
FailureCodeTracker |
errorCodes
If there are many failures, usually in a splitfile fetch, tracks the number of failures of each
type.
|
long |
expectedSize
The expected size of the data had the fetch succeeded, or -1.
|
java.lang.String |
extraMessage
Extra information about the failure.
|
FetchException.FetchExceptionMode |
mode
Failure mode
|
FreenetURI |
newURI
Try this URI instead.
|
static int |
UPPER_LIMIT_ERROR_CODE
There will never be more error codes than this constant.
|
Modifier and Type | Method and Description |
---|---|
FetchException |
clone() |
boolean |
finalizedSize()
Do we have any idea of the final size of the data?
|
java.lang.String |
getExpectedMimeType()
Do we know the expected MIME type of the data?
|
static java.lang.String |
getMessage(FetchException.FetchExceptionMode mode)
Get the (localised) long explanation for this failure mode.
|
FetchException.FetchExceptionMode |
getMode()
Get the failure mode.
|
java.lang.String |
getShortMessage()
Get the short name of this exception's failure.
|
static java.lang.String |
getShortMessage(FetchException.FetchExceptionMode mode)
Get the (localised) short name of this failure mode.
|
boolean |
isDataFound() |
static boolean |
isDataFound(FetchException.FetchExceptionMode mode,
FailureCodeTracker errorCodes) |
boolean |
isDefinitelyFatal() |
static boolean |
isDefinitelyFatal(FetchException.FetchExceptionMode mode) |
boolean |
isDNF() |
static boolean |
isErrorCode(int code) |
boolean |
isFatal()
Is an error fatal i.e.
|
static boolean |
isFatal(FetchException.FetchExceptionMode mode)
Is an error mode fatal i.e.
|
void |
setNotFinalizedSize()
Call to indicate the expected size and MIME type are unreliable.
|
java.lang.String |
toString() |
java.lang.String |
toUserFriendlyString() |
public final FetchException.FetchExceptionMode mode
public final FreenetURI newURI
public long expectedSize
public final FailureCodeTracker errorCodes
public final java.lang.String extraMessage
public static final int UPPER_LIMIT_ERROR_CODE
public FetchException(FetchException.FetchExceptionMode m)
public FetchException(FetchException.FetchExceptionMode m, long expectedSize, boolean finalizedSize, java.lang.String expectedMimeType)
public FetchException(FetchException.FetchExceptionMode m, long expectedSize, boolean finalizedSize, java.lang.String expectedMimeType, FreenetURI uri)
public FetchException(MetadataParseException e)
public FetchException(ArchiveFailureException e)
public FetchException(ArchiveRestartException e)
public FetchException(FetchException.FetchExceptionMode mode, java.lang.Throwable t)
public FetchException(FetchException.FetchExceptionMode mode, java.lang.String reason, java.lang.Throwable t)
public FetchException(FetchException.FetchExceptionMode mode, long expectedSize, java.lang.String reason, java.lang.Throwable t, java.lang.String expectedMimeType)
public FetchException(long expectedSize, DataFilterException t, java.lang.String expectedMimeType)
public FetchException(FetchException.FetchExceptionMode mode, long expectedSize, java.lang.Throwable t, java.lang.String expectedMimeType)
public FetchException(FetchException.FetchExceptionMode mode, FailureCodeTracker errorCodes)
public FetchException(FetchException.FetchExceptionMode mode, FailureCodeTracker errorCodes, java.lang.String msg)
public FetchException(FetchException.FetchExceptionMode mode, java.lang.String msg)
public FetchException(FetchException.FetchExceptionMode mode, FreenetURI newURI)
public FetchException(FetchException.FetchExceptionMode mode, java.lang.String msg, FreenetURI uri)
public FetchException(FetchException e, FetchException.FetchExceptionMode newMode)
public FetchException(FetchException e, FreenetURI uri)
public FetchException(FetchException e)
protected FetchException()
public java.lang.String getExpectedMimeType()
public boolean finalizedSize()
public FetchException.FetchExceptionMode getMode()
public java.lang.String getShortMessage()
public static java.lang.String getShortMessage(FetchException.FetchExceptionMode mode)
public java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String toUserFriendlyString()
public static java.lang.String getMessage(FetchException.FetchExceptionMode mode)
public boolean isFatal()
public static boolean isFatal(FetchException.FetchExceptionMode mode)
public boolean isDefinitelyFatal()
public static boolean isDefinitelyFatal(FetchException.FetchExceptionMode mode)
public void setNotFinalizedSize()
public FetchException clone()
clone
in class java.lang.Object
public boolean isDataFound()
public static boolean isDataFound(FetchException.FetchExceptionMode mode, FailureCodeTracker errorCodes)
public boolean isDNF()
public static boolean isErrorCode(int code)