public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static ArrayList<File> |
createFileList(String source,
String exclude,
String workspacePath)
Create a file list to scan
|
static String |
createScanResultLink(String scanURL,
String dataID)
Build a link to view scan result
|
static String |
inputStreamtoString(InputStream input)
Convert InputStream to String
|
static void |
listFilesRecursively(String sourcePath,
ArrayList<File> output,
String[] exclude)
List file recursively
|
static void |
removeDuplicateFileInList(ArrayList<File> input)
Remove duplicate files in a list
|
static void |
writeLogFile(String filePath,
String content,
boolean isAppend,
boolean isLog)
Create log file
|
public static void listFilesRecursively(String sourcePath, ArrayList<File> output, String[] exclude)
sourcePath
- the source file path, can be a file or folderoutput
- list of files inside sourcePathexclude
- exclude files/folders in this listpublic static void removeDuplicateFileInList(ArrayList<File> input)
input
- input listpublic static String createScanResultLink(String scanURL, String dataID)
scanURL
- the source file path, can be a file or folderdataID
- list of files inside sourcePathpublic static String inputStreamtoString(InputStream input) throws IOException
input
- input streamIOException
- in some circumstancepublic static ArrayList<File> createFileList(String source, String exclude, String workspacePath)
source
- the source file path, can be a file or folderexclude
- exclude files/folders from this listworkspacePath
- work space path to combineCopyright © 2016–2021. All rights reserved.