@Test public void testNonExistingPath() throws Exception { validator.validate("/X/Y/Z/This/Can/Not/Exists/Right/Question-mark"); assertEquals(Status.ERROR, validator.getStatus()); assertEquals(1, validator.getMessages().size()); }
@Override public void validate(String filePath) { if(StringUtils.isBlank(filePath)) { return; } File file = new File(filePath); if(!file.exists()) { addMessage(Status.ERROR, "Directory doesn't exists on Sqoop 2 server machine"); return; } if(!file.isDirectory()) { addMessage(Status.ERROR, "Path is not a valid directory"); return; } }
DirectoryExistsValidator extends AbstractValidator<String> { @Override public void validate(String filePath) { if(StringUtils.isBlank(filePath)) { return; } File file = new File(filePath); if(!file.exists()) { addMessage(Status.ERROR, "Directory doesn't exists on Sqoop 2 server machine"); return; } if(!file.isDirectory()) { addMessage(Status.ERROR, "Path is not a valid directory"); return; } } }
DirectoryExistsValidator extends AbstractValidator<String> { @Override public void validate(String filePath) { if(StringUtils.isBlank(filePath)) { return; } File file = new File(filePath); if(!file.exists()) { addMessage(Status.ERROR, "Directory doesn't exists on Sqoop 2 server machine"); return; } if(!file.isDirectory()) { addMessage(Status.ERROR, "Path is not a valid directory"); return; } }  }
DirectoryExistsValidator extends AbstractValidator<String> { @Override public void validate(String filePath) { if(StringUtils.isBlank(filePath)) { return; } File file = new File(filePath); if(!file.exists()) { addMessage(Status.ERROR, "Directory doesn't exists on Sqoop 2 server machine"); return; } if(!file.isDirectory()) { addMessage(Status.ERROR, "Path is not a valid directory"); return; } }  @Override void validate(String filePath); }
DirectoryExistsValidator extends AbstractValidator<String> { @Override public void validate(String filePath) { if(StringUtils.isBlank(filePath)) { return; } File file = new File(filePath); if(!file.exists()) { addMessage(Status.ERROR, "Directory doesn't exists on Sqoop 2 server machine"); return; } if(!file.isDirectory()) { addMessage(Status.ERROR, "Path is not a valid directory"); return; } }  @Override void validate(String filePath);  }