private boolean isValidLinkPathName(String linkPath) throws IOException {
if (isFilePath(linkPath) && !isValidDirectoryPath(linkPath)) {
String message = "Cannot create link to the file system path '" + linkPath + "'." +
" The canonical file system path used was ;" + createFileFromPath(linkPath).getCanonicalPath() + "'." +
" Either it doesn't exist or it's not a directory.";
response = new ErrorResponder(message).makeResponse(context, null);
response.setStatus(404);
return false;
} else if (!isFilePath(linkPath) && isInternalPageThatDoesntExist(linkPath)) {
response = new ErrorResponder("The page to which you are attempting to link, " + HtmlUtil.escapeHTML(linkPath) + ", doesn't exist.").makeResponse(context, null);
response.setStatus(404);
return false;
}
return true;
}