@Override
    public Path findPathInCurrentOrWorkDir(String uri) {

        Optional<Path> lookUpFile = pathMapper.lookUpFile(uri);

        if (lookUpFile.isPresent()) {
            return lookUpFile.get();
        }

        Optional<Path> inCurrentParent = Optional.empty();
        Optional<Path> inRoot = Optional.empty();

        try {
            inCurrentParent = Optional.ofNullable(current.currentTab().getPath().getParent());
        } catch (Exception e) {
            //no-op
        }

        try {
            if (inCurrentParent.isPresent()) {
                inRoot = inCurrentParent.map(Path::getRoot);
            } else {
                inRoot = workingDirectory.map(Path::getRoot);
            }
        } catch (Exception e) {
            //no-op
        }

        return Stream.<Optional<Path>>of(inCurrentParent, workingDirectory, inRoot)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .map(path -> path.resolve(uri))
                .filter(Files::exists)
                .findFirst()
                .orElseGet(() -> null);

    }
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