@Override
    public boolean delete(@NonNull final Uri uri) throws IOException {
        removeFromUriCache(uri); //very important to prevent IllegalArgumentExceptions due to nonexisting Uris!
        try {
            return DocumentsContract.deleteDocument(getContext().getContentResolver(), uri);
        } catch (IllegalArgumentException iae) {
            //this happens if uri is invalid, e.g. because document or containing folder was deleted externally to c:geo
            Log.d("Exception on trying to delete '" + uri + "' (assuming it was invalid): " + iae);
            return false;
        }
    }
LRU-cache for previously retrieved directory Uri's for Folders
main/src/main/java/cgeo/geocaching/storage/DocumentContentAccessor.java