Package io.sentry.cache
Class EnvelopeCache
java.lang.Object
io.sentry.cache.EnvelopeCache
- All Implemented Interfaces:
IEnvelopeCache,Iterable<SentryEnvelope>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final @NotNull Filestatic final Stringprotected final @NotNull SentryOptionsstatic final Stringprotected final @NotNull ISerializerstatic final Stringstatic final StringFile suffix added to all serialized envelopes files.protected static final Charset -
Constructor Summary
ConstructorsConstructorDescriptionEnvelopeCache(@NotNull SentryOptions options, @NotNull String cacheDirPath, int maxCacheItems) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull IEnvelopeCachecreate(@NotNull SentryOptions options) voiddiscard(@NotNull SentryEnvelope envelope) protected booleanCheck if a dir.@NotNull Iterator<SentryEnvelope>iterator()protected voidrotateCacheIfNeeded(@NotNull File[] files) Rotates the caching folder if full, deleting the oldest files firstvoidstore(@NotNull SentryEnvelope envelope, @NotNull Hint hint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sentry.cache.IEnvelopeCache
storeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SUFFIX_ENVELOPE_FILE
File suffix added to all serialized envelopes files.- See Also:
-
PREFIX_CURRENT_SESSION_FILE
- See Also:
-
CRASH_MARKER_FILE
- See Also:
-
NATIVE_CRASH_MARKER_FILE
- See Also:
-
STARTUP_CRASH_MARKER_FILE
- See Also:
-
UTF_8
-
options
-
serializer
-
directory
-
-
Constructor Details
-
EnvelopeCache
public EnvelopeCache(@NotNull @NotNull SentryOptions options, @NotNull @NotNull String cacheDirPath, int maxCacheItems)
-
-
Method Details
-
create
-
store
- Specified by:
storein interfaceIEnvelopeCache
-
discard
- Specified by:
discardin interfaceIEnvelopeCache
-
iterator
- Specified by:
iteratorin interfaceIterable<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
Rotates the caching folder if full, deleting the oldest files first- Parameters:
files- the Files
-