public WatchKey register()

in src/main/java/com/pastdev/jsch/nio/file/UnixSshPath.java [217:229]


    public WatchKey register( WatchService watcher, Kind<?>[] events, Modifier... modifiers ) throws IOException {
        if ( watcher == null ) {
            throw new NullPointerException();
        }
        if ( !(watcher instanceof UnixSshFileSystemWatchService) ) {
            throw new ProviderMismatchException();
        }
        if ( !getFileSystem().provider().readAttributes( this, BasicFileAttributes.class ).isDirectory() ) {
            throw new NotDirectoryException( this.toString() );
        }
        getFileSystem().provider().checkAccess( this, AccessMode.READ );
        return ((UnixSshFileSystemWatchService) watcher).register( this, events, modifiers );
    }