class Directory implements Serializable {

    public void validate() throws CruiseControlException {
        if (directory == null) {
            throw new DirectoryNotSpecifiedException("directory");
        }
        
        if (!exists()) {
            throw new DirectoryDoesNotExistException();
        }
        
        if (!isDirectory()) {
            throw new FileInsteadOfDirectoryException();
        }
    }

}