Java Path Resolve nio resolvePathElements(final Path path)

Here you can find the source of resolvePathElements(final Path path)

Description

resolve Path Elements

License

Open Source License

Declaration

static LinkedList<String> resolvePathElements(final Path path) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.file.Path;

import java.util.LinkedList;

import java.util.regex.Pattern;

import com.google.common.base.Strings;
import com.google.common.collect.Lists;

public class Main {
    static LinkedList<String> resolvePathElements(final Path path) {
        final LinkedList<String> elements = Lists.newLinkedList();

        final String[] elementArray = path.toString().split(Pattern.quote(path.getFileSystem().getSeparator()));

        for (final String element : elementArray) {
            if (!Strings.isNullOrEmpty(element)) {
                elements.add(element);//from  w  w w. j a v a2 s.c o  m
            }
        }

        return elements;
    }
}

Related

  1. resolve(Path workingDir, List paths, String file)
  2. resolveBagUri(final Path baseDir, final URI bagUri)
  3. resolveForSymbolic(final Path path)
  4. resolveMaxStep(String rootPath)
  5. resolvePath(final Path baseDirPath, final Path userPath)
  6. resolveSymLink(Path link)