private Uri createInternal(@NonNull final Folder folder, @NonNull final String name, final boolean validateCache) throws IOException, IllegalArgumentException {
        final Uri folderUri = getFolderUri(folder, true, true, validateCache);
        if (folderUri == null) {
            return null;
        }
        final String docName = FileUtils.createUniqueFilename(name, queryDir(folderUri, new String[]{DocumentsContract.Document.COLUMN_DISPLAY_NAME}, c -> c.getString(0)));
        try (ContextLogger ignore = new ContextLogger("DocumentFolderAccessor.create %s: %s", folder, name)) {
            return DocumentsContract.createDocument(getContext().getContentResolver(), folderUri, guessMimeTypeFor(docName), docName);
        }
    }
LRU-cache for previously retrieved directory Uri's for Folders
main/src/main/java/cgeo/geocaching/storage/DocumentContentAccessor.java