mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 10:59:01 +00:00
fix: improve dot message status
This commit is contained in:
parent
0f9f96dade
commit
a202116a0c
@ -43,34 +43,34 @@ public enum ExeState {
|
|||||||
NULL_UNDEFINED, OK, DOES_NOT_EXIST, IS_A_DIRECTORY, NOT_A_FILE, CANNOT_BE_READ;
|
NULL_UNDEFINED, OK, DOES_NOT_EXIST, IS_A_DIRECTORY, NOT_A_FILE, CANNOT_BE_READ;
|
||||||
|
|
||||||
public static ExeState checkFile(File dotExe) {
|
public static ExeState checkFile(File dotExe) {
|
||||||
if (dotExe == null) {
|
if (dotExe == null)
|
||||||
return NULL_UNDEFINED;
|
return NULL_UNDEFINED;
|
||||||
} else if (dotExe.exists() == false) {
|
else if (dotExe.exists() == false)
|
||||||
return DOES_NOT_EXIST;
|
return DOES_NOT_EXIST;
|
||||||
} else if (dotExe.isDirectory()) {
|
else if (dotExe.isDirectory())
|
||||||
return IS_A_DIRECTORY;
|
return IS_A_DIRECTORY;
|
||||||
} else if (dotExe.isFile() == false) {
|
else if (dotExe.isFile() == false)
|
||||||
return NOT_A_FILE;
|
return NOT_A_FILE;
|
||||||
} else if (dotExe.canRead() == false) {
|
else if (dotExe.canRead() == false)
|
||||||
return CANNOT_BE_READ;
|
return CANNOT_BE_READ;
|
||||||
}
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTextMessage() {
|
public String getTextMessage() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case OK:
|
case OK:
|
||||||
return "File OK";
|
return "Dot executable OK";
|
||||||
case NULL_UNDEFINED:
|
case NULL_UNDEFINED:
|
||||||
return "No dot executable found";
|
return "No dot executable found";
|
||||||
case DOES_NOT_EXIST:
|
case DOES_NOT_EXIST:
|
||||||
return "File does not exist";
|
return "Dot executable does not exist";
|
||||||
case IS_A_DIRECTORY:
|
case IS_A_DIRECTORY:
|
||||||
return "It should be an executable, not a directory";
|
return "Dot executable should be an executable, not a directory";
|
||||||
case NOT_A_FILE:
|
case NOT_A_FILE:
|
||||||
return "Not a valid file";
|
return "Dot executable is not a valid file";
|
||||||
case CANNOT_BE_READ:
|
case CANNOT_BE_READ:
|
||||||
return "File cannot be read";
|
return "Dot executable cannot be read";
|
||||||
}
|
}
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user