Package io.sentry.cache
Class EnvelopeCache
- java.lang.Object
-
- io.sentry.cache.EnvelopeCache
-
- All Implemented Interfaces:
IEnvelopeCache
,java.lang.Iterable<SentryEnvelope>
@Internal public final class EnvelopeCache extends java.lang.Object implements IEnvelopeCache
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CRASH_MARKER_FILE
protected @NotNull java.io.File
directory
static java.lang.String
NATIVE_CRASH_MARKER_FILE
protected @NotNull SentryOptions
options
static java.lang.String
PREFIX_CURRENT_SESSION_FILE
protected @NotNull ISerializer
serializer
static java.lang.String
SUFFIX_ENVELOPE_FILE
File suffix added to all serialized envelopes files.protected static java.nio.charset.Charset
UTF_8
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull IEnvelopeCache
create(@NotNull SentryOptions options)
void
discard(@NotNull SentryEnvelope envelope)
protected boolean
isDirectoryValid()
Check if a dir.@NotNull java.util.Iterator<SentryEnvelope>
iterator()
protected void
rotateCacheIfNeeded(@NotNull java.io.File[] files)
Rotates the caching folder if full, deleting the oldest files firstvoid
store(@NotNull SentryEnvelope envelope, @Nullable java.util.Map<java.lang.String,java.lang.Object> hint)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.sentry.cache.IEnvelopeCache
store
-
-
-
-
Field Detail
-
SUFFIX_ENVELOPE_FILE
public static final java.lang.String SUFFIX_ENVELOPE_FILE
File suffix added to all serialized envelopes files.- See Also:
- Constant Field Values
-
PREFIX_CURRENT_SESSION_FILE
public static final java.lang.String PREFIX_CURRENT_SESSION_FILE
- See Also:
- Constant Field Values
-
CRASH_MARKER_FILE
public static final java.lang.String CRASH_MARKER_FILE
- See Also:
- Constant Field Values
-
NATIVE_CRASH_MARKER_FILE
public static final java.lang.String NATIVE_CRASH_MARKER_FILE
- See Also:
- Constant Field Values
-
UTF_8
protected static final java.nio.charset.Charset UTF_8
-
options
@NotNull protected final @NotNull SentryOptions options
-
serializer
@NotNull protected final @NotNull ISerializer serializer
-
directory
@NotNull protected final @NotNull java.io.File directory
-
-
Method Detail
-
create
@NotNull public static @NotNull IEnvelopeCache create(@NotNull @NotNull SentryOptions options)
-
store
public void store(@NotNull @NotNull SentryEnvelope envelope, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> hint)
- Specified by:
store
in interfaceIEnvelopeCache
-
discard
public void discard(@NotNull @NotNull SentryEnvelope envelope)
- Specified by:
discard
in interfaceIEnvelopeCache
-
iterator
@NotNull public @NotNull java.util.Iterator<SentryEnvelope> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<SentryEnvelope>
-
isDirectoryValid
protected boolean isDirectoryValid()
Check if a dir. is valid and have write and read permission- Returns:
- true if valid and has permissions or false otherwise
-
rotateCacheIfNeeded
protected void rotateCacheIfNeeded(@NotNull @NotNull java.io.File[] files)
Rotates the caching folder if full, deleting the oldest files first- Parameters:
files
- the Files
-
-