< prev index next >

src/java.base/share/classes/java/nio/file/InvalidPathException.java

Print this page




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.nio.file;
  27 
  28 /**
  29  * Unchecked exception thrown when path string cannot be converted into a
  30  * {@link Path} because the path string contains invalid characters, or
  31  * the path string is invalid for other file system specific reasons.
  32  *
  33  * @since 1.7
  34  */
  35 
  36 public class InvalidPathException
  37     extends IllegalArgumentException
  38 {

  39     static final long serialVersionUID = 4355821422286746137L;
  40 
  41     private String input;
  42     private int index;
  43 
  44     /**
  45      * Constructs an instance from the given input string, reason, and error
  46      * index.
  47      *
  48      * @param  input   the input string
  49      * @param  reason  a string explaining why the input was rejected
  50      * @param  index   the index at which the error occurred,
  51      *                 or {@code -1} if the index is not known
  52      *
  53      * @throws  NullPointerException
  54      *          if either the input or reason strings are {@code null}
  55      *
  56      * @throws  IllegalArgumentException
  57      *          if the error index is less than {@code -1}
  58      */




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.nio.file;
  27 
  28 /**
  29  * Unchecked exception thrown when path string cannot be converted into a
  30  * {@link Path} because the path string contains invalid characters, or
  31  * the path string is invalid for other file system specific reasons.
  32  *
  33  * @since 1.7
  34  */
  35 
  36 public class InvalidPathException
  37     extends IllegalArgumentException
  38 {
  39     @java.io.Serial
  40     static final long serialVersionUID = 4355821422286746137L;
  41 
  42     private String input;
  43     private int index;
  44 
  45     /**
  46      * Constructs an instance from the given input string, reason, and error
  47      * index.
  48      *
  49      * @param  input   the input string
  50      * @param  reason  a string explaining why the input was rejected
  51      * @param  index   the index at which the error occurred,
  52      *                 or {@code -1} if the index is not known
  53      *
  54      * @throws  NullPointerException
  55      *          if either the input or reason strings are {@code null}
  56      *
  57      * @throws  IllegalArgumentException
  58      *          if the error index is less than {@code -1}
  59      */


< prev index next >