in c3r-cli-spark/src/main/java/com/amazonaws/c3r/spark/config/SparkConfig.java [59:81]
private void validate() {
FileUtil.verifyWritableDirectory(getTargetFile(), isOverwrite());
final Path source = Path.of(getSourceFile());
if (source.toFile().isFile()) {
FileUtil.verifyReadableFile(getSourceFile());
if (getFileFormat() == null) {
throw new C3rIllegalArgumentException("Unknown file extension: please specify the file format for file "
+ getSourceFile() + ".");
}
} else {
FileUtil.verifyReadableDirectory(getSourceFile());
if (getFileFormat() == null) {
throw new C3rIllegalArgumentException("An input file format must be selected if providing a source directory.");
}
}
if (getFileFormat() != FileFormat.CSV) {
if (getCsvInputNullValue() != null || getCsvOutputNullValue() != null) {
throw new C3rIllegalArgumentException("CSV options specified for " + getFileFormat() + " file.");
}
}
}