private fun locate(name: String): File? { var prefix = "" var sourceFile: File? = null var idx = 0 while (true) { if (idx == 0 && ToolIO.getUserDir() != null) { sourceFile = File(ToolIO.getUserDir(), name) } else { sourceFile = File(prefix + name) } if (sourceFile.exists()) break if (idx >= libraryPathEntries.size()) break prefix = libraryPathEntries.elementAt(idx++) } return sourceFile }
Searches for the file in current directory ( ToolIO.userDirectory ) and in library paths