public boolean endsWith()

in src/main/java/com/pastdev/jsch/nio/file/UnixSshPath.java [72:92]


    public boolean endsWith( Path path ) {
        if ( !getFileSystem().equals( path.getFileSystem() ) ) {
            return false;
        }
        if ( path.isAbsolute() && !isAbsolute() ) {
            return false;
        }

        int count = getNameCount();
        int otherCount = path.getNameCount();
        if ( otherCount > count ) {
            return false;
        }

        for ( count--, otherCount--; otherCount >= 0; count--, otherCount-- ) {
            if ( !path.getName( otherCount ).toString().equals( getName( count ).toString() ) ) {
                return false;
            }
        }
        return true;
    }