diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java b/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java index b13246dbf1..eef7dd1824 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java @@ -3,9 +3,7 @@ */ package net.sourceforge.pmd; -import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; @@ -51,6 +49,9 @@ import net.sourceforge.pmd.util.datasource.ReaderDataSource; import net.sourceforge.pmd.util.log.ConsoleLogHandler; import net.sourceforge.pmd.util.log.ScopedLogHandlersManager; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; + /** * This is the main class for interacting with PMD. The primary flow of all Rule * process is controlled via interactions with this class. A command line @@ -428,8 +429,9 @@ public class PMD { LOG.log(Level.SEVERE, "Problem with Input File Path", inputFilePath); throw new RuntimeException("Problem with Input File Path: " + inputFilePath); } else { - BufferedReader br = new BufferedReader(new FileReader(file)); - String filePaths = br.readLine(); + String filePaths = FileUtils.readFileToString(new File(inputFilePath)); + filePaths = StringUtils.trimToEmpty(filePaths); + if (null == filePaths){ LOG.log(Level.SEVERE, "Problem with Input File Path", inputFilePath); throw new RuntimeException("Problem with Input File Path: " + inputFilePath); diff --git a/src/site/markdown/usage/running.md.vm b/src/site/markdown/usage/running.md.vm index 86f3f20a5b..3e1450101f 100644 --- a/src/site/markdown/usage/running.md.vm +++ b/src/site/markdown/usage/running.md.vm @@ -106,6 +106,12 @@ The tool comes with a rather extensive help text, simply running with `-help`! no plsql + + -filelist + Path to file containing a comma delimited list of files to analyze. If this is given, then you don't need to provide `-dir`. + no + + -debug / -verbose / -D / -V Debug mode. Prints more log output.