com.rationaleemotions.FileStatOutput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-ssh Show documentation
Show all versions of simple-ssh Show documentation
A simple way of interacting with a remote host for executing commands, scp (upload and download)
The newest version!
package com.rationaleemotions;
/**
*
*/
enum FileStatOutput {
FILE,
DIRECTORY,
DOESNOT_EXIST,
UNKNOWN;
static FileStatOutput parse(String text) {
if (text == null || text.trim().isEmpty()) {
return UNKNOWN;
}
if ("regular file".equalsIgnoreCase(text.trim())) {
return FILE;
}
if ("directory".equalsIgnoreCase(text.trim())) {
return DIRECTORY;
}
if (text.trim().toLowerCase().contains("no such file or directory")) {
return DOESNOT_EXIST;
}
return UNKNOWN;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy