options() {
+ return options_;
+ }
+
/**
* Sets the output file.
*
@@ -296,11 +375,35 @@ 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.
*
@@ -309,33 +412,105 @@ public class CheckstyleOperation extends AbstractProcessOperation dirs) {
+ sourceDir_.addAll(dirs);
return this;
}
/**
- * Specified the file(s) or folder(s) containing the source files to check.
+ * 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.
*
* @param dirs the directories
* @return the checkstyle operation
* @see #sourceDir(String...)
*/
- public CheckstyleOperation sourceDir(Collection dirs) {
- sourceDirs.addAll(dirs.stream().filter(this::isNotBlank).toList());
- return this;
+ public CheckstyleOperation sourceDirStrings(Collection dirs) {
+ return sourceDir(dirs.stream().map(File::new).toList());
}
/**
@@ -352,7 +527,7 @@ public class CheckstyleOperation extends AbstractProcessOperation