Update docs and use better File functions
This commit is contained in:
@ -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);
|
||||
|
@ -106,6 +106,12 @@ The tool comes with a rather extensive help text, simply running with `-help`!
|
||||
<td>no</td>
|
||||
<td>plsql</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-filelist</td>
|
||||
<td>Path to file containing a comma delimited list of files to analyze. If this is given, then you don't need to provide `-dir`.</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-debug / -verbose / -D / -V</td>
|
||||
<td>Debug mode. Prints more log output.</td>
|
||||
|
Reference in New Issue
Block a user