MCPcopy Create free account
hub / github.com/buggins/coolreader / autoAddRoots

Method autoAddRoots

android/src/org/coolreader/crengine/Scanner.java:586–618  ·  view source on GitHub ↗
( String rootPath, String[] pathsToExclude )

Source from the content-addressed store, hash-verified

584 }
585
586 private void autoAddRoots( String rootPath, String[] pathsToExclude )
587 {
588 try {
589 File root = new File(rootPath);
590 File[] files = root.listFiles();
591 if ( files!=null ) {
592 for ( File f : files ) {
593 if ( !f.isDirectory() )
594 continue;
595 String fullPath = f.getAbsolutePath();
596 if ( engine.isLink(fullPath) ) {
597 L.d("skipping symlink " + fullPath);
598 continue;
599 }
600 boolean skip = false;
601 for ( String path : pathsToExclude ) {
602 if ( fullPath.startsWith(path) ) {
603 skip = true;
604 break;
605 }
606 }
607 if ( skip )
608 continue;
609 if ( !f.canWrite() )
610 continue;
611 L.i("Found possible mount point " + f.getAbsolutePath());
612 addRoot(f.getAbsolutePath(), f.getAbsolutePath(), true);
613 }
614 }
615 } catch ( Exception e ) {
616 L.w("Exception while trying to auto add roots");
617 }
618 }
619
620 public static final String[] SD_MOUNT_POINTS = {
621 "/system/media/sdcard",

Callers

nothing calls this directly

Calls 6

dMethod · 0.95
iMethod · 0.95
addRootMethod · 0.95
wMethod · 0.95
isLinkMethod · 0.80
startsWithMethod · 0.80

Tested by

no test coverage detected