code: @Override
      public void setAttempts(String projectId, String eventCollection, String attemptsString) throws IOException {
          // Prepare the collection cache directory.
          File collectionCacheDir = prepareCollectionDir(projectId, eventCollection);
  
          // Create the cache file.
          File cacheFile = new File(collectionCacheDir, ATTEMPTS_JSON_FILE_NAME);
  
          // Write the event to the cache file.
          OutputStream out = new FileOutputStream(cacheFile);
          Writer writer = null;
          try {
              writer = new OutputStreamWriter(out, ENCODING);
              writer.write(attemptsString);
          } finally {
              KeenUtils.closeQuietly(writer);
          }
      }
docs: {@inheritDoc}