public boolean startsWith()

in src/main/java/com/pastdev/jsch/nio/file/UnixSshPath.java [339:360]


    public boolean startsWith( Path other ) {
        if ( !getFileSystem().equals( other.getFileSystem() ) ) {
            return false;
        }
        if ( (other.isAbsolute() && !isAbsolute()) ||
                (isAbsolute() && !other.isAbsolute()) ) {
            return false;
        }

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

        for ( int i = 0; i < otherCount; i++ ) {
            if ( !other.getName( i ).toString().equals( getName( i ).toString() ) ) {
                return false;
            }
        }
        return true;
    }