@Throws(IOException::class) fun findAvailableStrings(uri: String): List<String>? { _resourcesNotLoaded.clear() val fulluri: String = _path + uri val strings: MutableList<String> = ArrayList() val resources: Enumeration<URL> = getResources(fulluri) while (resources.hasMoreElements()) { val url: URL = resources.nextElement() try { val string: String = readContents(url) strings.add(string) } catch (notAvailable: IOException) { _resourcesNotLoaded.add(url.toExternalForm()) } } return strings }
Reads the contents of the found URLs as a Strings and returns them . Individual URLs that can not be read are skipped and added to the list of 'resourcesNotLoaded '