private Path findClosestParentOrWorkdir(Path path) {
        if (Files.exists(path)) {
            return path;
        } else {
            Path parent = path.getParent();
            if (Objects.isNull(parent)) {
                return workingDirectory();
            } else {
                return findClosestParentOrWorkdir(parent);
            }
        }
    }
Resolve a file to a valid base browsing directory
@param referenceFile The base directory or a child file that should be used as a browsing base path
@return A valid directory's File object
src/main/java/com/kodedu/service/impl/DirectoryServiceImpl.java