@Test public void shouldCreateDifferentStorageForDifferentApiKeys() { String s1 = new RaygunOnFailedSendOfflineStorageHandler(storageDir, "myApiKey").getStorage("").getName(); String s2 = new RaygunOnFailedSendOfflineStorageHandler(storageDir, "myApiKey").getStorage("").getName(); assertEquals(s1, ".raygun_offline_storage_lxertb"); assertEquals(s2, s2); String s3 = new RaygunOnFailedSendOfflineStorageHandler(storageDir, "notMyApiKey").getStorage("").getName(); assertNotEquals(s1, s3); }
File getStorage(String storageDir) { return new File(new File(storageDir).getAbsolutePath(), ".raygun_offline_storage_" + apiKeyHash).getAbsoluteFile(); }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { File getStorage(String storageDir) { return new File(new File(storageDir).getAbsolutePath(), ".raygun_offline_storage_" + apiKeyHash).getAbsoluteFile(); } }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { File getStorage(String storageDir) { return new File(new File(storageDir).getAbsolutePath(), ".raygun_offline_storage_" + apiKeyHash).getAbsoluteFile(); } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { File getStorage(String storageDir) { return new File(new File(storageDir).getAbsolutePath(), ".raygun_offline_storage_" + apiKeyHash).getAbsoluteFile(); } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); void setEnabled(boolean enabled); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); String onFailedSend(RaygunClient client, String jsonPayload); IRaygunOnBeforeSend create(); }
RaygunOnFailedSendOfflineStorageHandler implements IRaygunOnFailedSend, IRaygunOnBeforeSend, IRaygunSendEventFactory { File getStorage(String storageDir) { return new File(new File(storageDir).getAbsolutePath(), ".raygun_offline_storage_" + apiKeyHash).getAbsoluteFile(); } RaygunOnFailedSendOfflineStorageHandler(String storageDir, String apiKey); void setEnabled(boolean enabled); RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message); String onFailedSend(RaygunClient client, String jsonPayload); IRaygunOnBeforeSend create();  }