@ NonNull @ Override public File getParent ( @ NonNull final File from ) { if ( from . getPath ( ) . equals ( getRoot ( ) . getPath ( ) ) ) { // Already at root, we can't go higher return from ; } else if ( from . getParentFile ( ) != null ) { return from . getParentFile ( ) ; } else { return from ; } }
Return the path to the parent directory . Should return the root if from is root .