|
|
@ -16,10 +16,12 @@ abstract class Engine extends Logging{ |
|
|
|
|
|
|
|
def getAllImageFiles(directoryPath:String, recursive:Boolean=false, recursiveDepth:Int=500):List[File] = { |
|
|
|
val fileList = new mutable.MutableList[File]() |
|
|
|
if (directoryPath != null && directoryPath != "") { |
|
|
|
val directory:File = new File(directoryPath) |
|
|
|
val imageFilter = new ImageFilter |
|
|
|
if (directory.isDirectory) { |
|
|
|
val files = directory.listFiles(imageFilter) |
|
|
|
if (files != null) { |
|
|
|
fileList ++= files |
|
|
|
info(s"Found ${files.length} files that are images in directory: $directoryPath") |
|
|
|
if (recursive) { |
|
|
@ -30,6 +32,8 @@ abstract class Engine extends Logging{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
fileList.toList |
|
|
|
} |
|
|
|
|
|
|
|