protected PathMatcher getPathMatcher() { if( getPattern() == null ) return path -> true; FileSystem fileSystem = getPath().getFileSystem(); return fileSystem.getPathMatcher( getPattern() ); }
protected void verify() { super.verify(); if( maxDepth < 0 ) throw new IllegalArgumentException( "maxDepth must be greater than 0, given: " + maxDepth ); try { getPathMatcher(); } catch( RuntimeException exception ) { throw new IllegalArgumentException( "could not parse pattern: " + getPattern(), exception ); } }
@Override public TupleEntryIterator openForRead( FlowProcess<? extends Properties> flowProcess, InputStream input ) throws IOException if( !Files.isDirectory( getPath() ) && getPattern() != null ) throw new IllegalStateException( "a file pattern was provided and given path is not a directory: " + getPath() );