/**
 * Copyright (C) 2010 the original author or authors.
 * See the notice.md file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.beust.jcommander.converters;

import com.beust.jcommander.IStringConverter;

import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * Convert a string into a path.
 * 
 * @author samvv
 */
public class PathConverter implements IStringConverter<Path> {
  
  public Path convert(String value) {
    return Paths.get(value);
  }
  
}

@@ -802,26 +802,71 @@
 der.
-IStringConverter;%0A
+ParameterException;%0A%0Aimport java.nio.file.InvalidPathException;
 %0Aimp
@@ -957,17 +957,16 @@
 path.%0A *
- 
 %0A * @aut
@@ -1010,26 +1010,20 @@
 ter 
-implements IString
+extends Base
 Conv
@@ -1036,18 +1036,88 @@
 Path%3E %7B%0A
+%0A
   
+public PathConverter(String optionName) %7B%0A    super(optionName);%0A  %7D%0A
 %0A  publi
@@ -1143,24 +1143,36 @@
 ng value) %7B%0A
+    try %7B%0A  
     return P
@@ -1194,11 +1194,122 @@
 ;%0A  
-%7D%0A
   
+%7D catch (InvalidPathException e) %7B%0A      throw new ParameterException(getErrorString(value, %22a path%22));%0A    %7D%0A  %7D
 %0A%7D%0A

Fix error message when failing to convert a Path