private static @Nullable Path mapPath(String path, Path oldTarget, Path newTarget) {
    String oldTargetPath = oldTarget.toString();
    if (path.startsWith(oldTargetPath)) {
      if (path.length() == oldTargetPath.length()) {
        return newTarget;
      }
      if (path.charAt(oldTargetPath.length()) == File.separatorChar) {
        return newTarget.resolve(path.substring(oldTargetPath.length() + 1));
      }
    }
    return null;
  }
private static @Nullable Path mapPath(String path, Path oldTarget, Path newTarget)