Added comments

This commit is contained in:
Eugene Livis 2016-01-11 16:12:30 -05:00
parent 939885d11d
commit 0d38fd257c
2 changed files with 20 additions and 4 deletions

View File

@ -168,7 +168,8 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
} }
/** /**
* Locate all supported virtual machine files, if any, contained in a data source. * Locate all supported virtual machine files, if any, contained in a data
* source.
* *
* @param dataSource The data source. * @param dataSource The data source.
* *
@ -186,10 +187,17 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
return vmFiles; return vmFiles;
} }
/**
* Writes out an abstract file to a specified output folder.
*
* @param vmFile Abstract file to write to disk.
* @param outputFolderForThisVM Absolute path to output folder.
*
* @throws IOException
*/
private void writeVirtualMachineToDisk(AbstractFile vmFile, String outputFolderForThisVM) throws IOException { private void writeVirtualMachineToDisk(AbstractFile vmFile, String outputFolderForThisVM) throws IOException {
// TODO: check available disk space first? See IngestMonitor.getFreeSpace() // TODO: check available disk space first? See IngestMonitor.getFreeSpace()
// check if output folder exists // check if output folder exists
File destinationFolder = Paths.get(outputFolderForThisVM).toFile(); File destinationFolder = Paths.get(outputFolderForThisVM).toFile();
if (!destinationFolder.exists()) { if (!destinationFolder.exists()) {

View File

@ -189,6 +189,14 @@ public final class VirtualMachineFinderUtility {
return false; return false;
} }
/**
* Returns a list of all file names in the folder of interest. Sub-folders
* are excluded.
*
* @param path Absolute path of the folder of interest
*
* @return List of all file names in the folder of interest
*/
private static List<String> getAllFilesInFolder(String path) { private static List<String> getAllFilesInFolder(String path) {
// only returns files, skips folders // only returns files, skips folders
File file = new File(path); File file = new File(path);