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