Tabnine Logo
CrashReportPersister
Code IndexAdd Tabnine to your IDE (free)

How to use
CrashReportPersister
in
org.acra.file

Best Java code snippets using org.acra.file.CrashReportPersister (Showing top 5 results out of 315)

origin: ACRA/acra

/**
 * Send crash report given user's comment and email address.
 *
 * @param comment   Comment (may be null) provided by the user.
 * @param userEmail Email address (may be null) provided by the client.
 */
protected final void sendCrash(@Nullable String comment, @Nullable String userEmail) {
  new Thread(() -> {
    final CrashReportPersister persister = new CrashReportPersister();
    try {
      if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Add user comment to " + reportFile);
      final CrashReportData crashData = persister.load(reportFile);
      crashData.put(USER_COMMENT, comment == null ? "" : comment);
      crashData.put(USER_EMAIL, userEmail == null ? "" : userEmail);
      persister.store(crashData, reportFile);
    } catch (IOException | JSONException e) {
      ACRA.log.w(LOG_TAG, "User comment not added: ", e);
    }
    // Start the report sending task
    new SchedulerStarter(this, config).scheduleReports(reportFile, false);
  }).start();
}
origin: ACRA/acra

  /**
   * Store a report
   *
   * @param file      the file to store in
   * @param crashData the content
   */
  private void saveCrashReportFile(@NonNull File file, @NonNull CrashReportData crashData) {
    try {
      if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Writing crash report file " + file);
      final CrashReportPersister persister = new CrashReportPersister();
      persister.store(crashData, file);
    } catch (Exception e) {
      ACRA.log.e(LOG_TAG, "An error occurred while writing the report file...", e);
    }
  }
}
origin: ACRA/acra

final CrashReportPersister persister = new CrashReportPersister();
final CrashReportData previousCrashReport = persister.load(reportFile);
sendCrashReport(previousCrashReport);
IOUtils.deleteFile(reportFile);
origin: ACRA/acra

void convert() {
  ACRA.log.i(LOG_TAG, "Converting unsent ACRA reports to json");
  final ReportLocator locator = new ReportLocator(context);
  final CrashReportPersister persister = new CrashReportPersister();
  final List<File> reportFiles = new ArrayList<>();
  reportFiles.addAll(Arrays.asList(locator.getUnapprovedReports()));
      final CrashReportData data = legacyLoad(new InputStreamReader(in, "ISO8859-1")); //$NON-NLS-1$
      if (data.containsKey(ReportField.REPORT_ID) && data.containsKey(ReportField.USER_CRASH_DATE)) {
        persister.store(data, report);
        converted++;
      } else {
      try {
        persister.load(report);
        if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Tried to convert already converted report file " + report.getPath() + ". Ignoring");
      } catch (Exception t) {
origin: ACRA/acra

final CharSequence comment = remoteInput.getCharSequence(NotificationInteraction.KEY_COMMENT);
if (comment != null && !"".equals(comment.toString())) {
  final CrashReportPersister persister = new CrashReportPersister();
  try {
    if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Add user comment to " + reportFile);
    final CrashReportData crashData = persister.load(reportFile);
    crashData.put(USER_COMMENT, comment.toString());
    persister.store(crashData, reportFile);
  } catch (@NonNull IOException | JSONException e) {
    ACRA.log.w(LOG_TAG, "User comment not added: ", e);
org.acra.fileCrashReportPersister

Javadoc

Handles persistence of CrashReportData

Most used methods

  • <init>
  • load
    Loads properties from the specified File.
  • store
    Stores the mappings in this Properties to the specified OutputStream, putting the specified comment

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • startActivity (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JTextField (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now