options() {
- return options_;
- }
-
/**
* Sets the output file.
*
@@ -375,35 +296,11 @@ public class CheckstyleOperation extends AbstractProcessOperation
- * Defaults to stdout.
- *
- * @param file the output file
- * @return the checkstyle operation
- */
- public CheckstyleOperation outputPath(File file) {
- return outputPath(file.getAbsolutePath());
- }
-
- /**
- * Sets the output file.
- *
- * Defaults to stdout.
- *
- * @param file the output file
- * @return the checkstyle operation
- */
- public CheckstyleOperation outputPath(Path file) {
- return outputPath(file.toFile().getAbsolutePath());
- }
-
/**
* Sets the property files to load.
*
@@ -412,105 +309,33 @@ public class CheckstyleOperation extends AbstractProcessOperation dirs) {
- sourceDir_.addAll(dirs);
+ public CheckstyleOperation sourceDir(String... dir) {
+ sourceDirs.addAll(Arrays.stream(dir).filter(this::isNotBlank).toList());
return this;
}
/**
- * Returns the file(s) or folders(s) containing the sources files to check
- *
- * @return the files or directories
- */
- public Set sourceDir() {
- return sourceDir_;
- }
-
- /**
- * Specifies the file(s) or folder(s) containing the source files to check.
- *
- * @param dirs the directories
- * @return the checkstyle operation
- * @see #sourceDir(Path...)
- */
- public CheckstyleOperation sourceDirPaths(Collection dirs) {
- return sourceDir(dirs.stream().map(Path::toFile).toList());
- }
-
- /**
- * Specifies the file(s) or folder(s) containing the source files to check.
+ * Specified the file(s) or folder(s) containing the source files to check.
*
* @param dirs the directories
* @return the checkstyle operation
* @see #sourceDir(String...)
*/
- public CheckstyleOperation sourceDirStrings(Collection dirs) {
- return sourceDir(dirs.stream().map(File::new).toList());
+ public CheckstyleOperation sourceDir(Collection dirs) {
+ sourceDirs.addAll(dirs.stream().filter(this::isNotBlank).toList());
+ return this;
}
/**
@@ -527,7 +352,7 @@ public class CheckstyleOperation extends AbstractProcessOperation