Here you can find the source of isRelativized(final Path base, final String successor)
public static boolean isRelativized(final Path base, final String successor)
//package com.java2s; //License from project: Apache License import java.nio.file.Path; import java.nio.file.Paths; import java.util.Objects; public class Main { public static boolean isRelativized(final Path base, final String successor) { return isRelativized(base, Paths.get(successor)); }/*from w ww. j a v a2s .co m*/ public static boolean isRelativized(final Path base, final Path successor) { Objects.requireNonNull(base); Objects.requireNonNull(successor); final Path baseNormalized = base.normalize(); final Path successorNormalized = successor.normalize(); return baseNormalized.relativize(baseNormalized.resolve(successorNormalized)).equals(successorNormalized); } }