Here you can find the source of resolve(Path directory, String... parts)
directory/parts[0]/parts[1]/.../parts[n]
.
Parameter | Description |
---|---|
directory | root directory for resolve |
parts | parts of the path relative to directory |
public static Path resolve(Path directory, String... parts)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.nio.file.Path; public class Main { /**//from w w w .j ava 2 s . co m * Resolves the Path to the file or directory under the <code> * directory/parts[0]/parts[1]/.../parts[n]</code>. * * @param directory root directory for resolve * @param parts parts of the path relative to directory * @return resolved Path */ public static Path resolve(Path directory, String... parts) { Path current = directory; for (String part : parts) { current = current.resolve(part); } return current; } }