All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pastdev.jsch.scp.DestinationOs Maven / Gradle / Ivy

Go to download

A set of extensions on top of JSch providing a full SCP protocol implementation, tunneling including multi-hop, a Java 7 FileSystem like implementation for Java 6 and remote command execution

There is a newer version: 0.1.11
Show newest version
package com.pastdev.jsch.scp;

public enum DestinationOs {
    UNIX('/'),
    WINDOWS('\\');

    private char separator;

    private DestinationOs( char separator ) {
        this.separator = separator;
    }

    public String joinPath( String[] parts ) {
        return joinPath( parts, 0, parts.length );
    }

    public String joinPath( String[] parts, int start, int count ) {
        StringBuilder builder = new StringBuilder();
        for ( int i = start, end = start + count; i < end; i++ ) {
            if ( i > start ) {
                builder.append( separator );
            }
            builder.append( parts[i] );
        }
        return builder.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy