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.StringCRASH_MARKER_FILEprotected @NotNull java.io.Filedirectorystatic java.lang.StringNATIVE_CRASH_MARKER_FILEprotected @NotNull SentryOptionsoptionsstatic java.lang.StringPREFIX_CURRENT_SESSION_FILEprotected @NotNull ISerializerserializerstatic java.lang.StringSUFFIX_ENVELOPE_FILEFile suffix added to all serialized envelopes files.protected static java.nio.charset.CharsetUTF_8
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull IEnvelopeCachecreate(@NotNull SentryOptions options)voiddiscard(@NotNull SentryEnvelope envelope)protected booleanisDirectoryValid()Check if a dir.@NotNull java.util.Iterator<SentryEnvelope>iterator()protected voidrotateCacheIfNeeded(@NotNull java.io.File[] files)Rotates the caching folder if full, deleting the oldest files firstvoidstore(@NotNull SentryEnvelope envelope, @Nullable 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.lang.Object hint)- Specified by:
storein interfaceIEnvelopeCache
-
discard
public void discard(@NotNull @NotNull SentryEnvelope envelope)- Specified by:
discardin interfaceIEnvelopeCache
-
iterator
@NotNull public @NotNull java.util.Iterator<SentryEnvelope> iterator()
- Specified by:
iteratorin 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
-
-