}
}
else if (isCwdAndTokenAFile()) {
listPossibleDirectories(completion);
if (completion.getCompletionCandidates().size() == 1) {
completion.getCompletionCandidates().set(0, new TerminalString("", true));
// append when we have a file
completion.doAppendSeparator(true);
}
else if (completion.getCompletionCandidates().size() == 0) {
completion.addCompletionCandidate("");
// append when we have a file
completion.doAppendSeparator(true);
}
}
// not a directory or file, list what we find
else {
listPossibleDirectories(completion);
}
}
else if (startWithSlash() || startWithWindowsDrive()) {
if (isTokenADirectory()) {
if (tokenEndsWithSlash()) {
completion.addCompletionCandidates(
listDirectory(cwd.newInstance(token), null));
}
else
completion.addCompletionCandidate(Config.getPathSeparator());
}
else if (isTokenAFile()) {
listPossibleDirectories(completion);
if (completion.getCompletionCandidates().size() == 1) {
completion.getCompletionCandidates().set(0, new TerminalString("", true));
// completion.addCompletionCandidate("");
// append when we have a file
completion.doAppendSeparator(true);
}
}