for (int i = 0; i < parts.length; i++) {
if (path.equals("otg:/")) break;
if (parts[i].equals("otg:") || parts[i].equals("")) continue;
Log.d(context.getClass().getSimpleName(), "Currently at: " + parts[i]);
DocumentFile nextDocument = rootUri.findFile(parts[i]);
<BUG>if (nextDocument == null || !nextDocument.exists()) {
nextDocument = rootUri.createFile(parts[i].substring(parts[i].lastIndexOf(".")), parts[i]);
Log.d(context.getClass().getSimpleName(), "NOT FOUND! File created: " + parts[i]);
}</BUG>
rootUri = nextDocument;

for (int i = 0; i < parts.length; i++) {
if (path.equals("otg:/")) break;
if (parts[i].equals("otg:") || parts[i].equals("")) continue;
Log.d(context.getClass().getSimpleName(), "Currently at: " + parts[i]);
DocumentFile nextDocument = rootUri.findFile(parts[i]);
rootUri = nextDocument;
