private static Path validatePath ( Path path ) { final URI uri = path . toUri ( ) ; final String scheme = uri . getScheme ( ) ; final String pathPart = uri . getPath ( ) ; // some validity checks if ( scheme == null ) { throw new IllegalArgumentException ( "The scheme (hdfs://, file://, etc) is null. " + "Please specify the file system scheme explicitly in the URI." ) ; } if ( pathPart == null ) { throw new IllegalArgumentException ( "The path to store the checkpoint data in is null. " + "Please specify a directory path for the checkpoint data." ) ; } if ( pathPart . length ( ) == 0 || pathPart . equals ( "/" ) ) { throw new IllegalArgumentException ( "Cannot use the root directory for checkpoints." ) ; } return path ; }
Checks the validity of the path s scheme and path .