com.pastdev.jsch.scp.DestinationOs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsch-extension Show documentation
Show all versions of jsch-extension Show documentation
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
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();
}
}