class RuleDatabaseItemUpdateRunnable implements Runnable {

    void downloadFile(File file, SingleWriterMultipleReaderFile singleWriterMultipleReaderFile, HttpURLConnection connection) throws IOException {
        InputStream inStream = connection.getInputStream();
        FileOutputStream outStream = singleWriterMultipleReaderFile.startWrite();

        try {
            copyStream(inStream, outStream);

            singleWriterMultipleReaderFile.finishWrite(outStream);
            outStream = null;
            // Write has started, set modification time.
            if (connection.getLastModified() == 0 || !file.setLastModified(connection.getLastModified())) {
                Log.d(TAG, "downloadFile: Could not set last modified");
            }
        } finally {
            if (outStream != null)
                singleWriterMultipleReaderFile.failWrite(outStream);
        }
    }

      RuleDatabaseItemUpdateRunnable(@NonNull RuleDatabaseUpdateTask parentTask, @NonNull Context context, @NonNull Configuration.Item item);

}