- private String getSubject(URL source) throws IOException {
- try {
- File file = new File(source.toURI());
- return file.getParentFile().getName();
- } catch (URISyntaxException e) {
- throw new IOException("Cannot parse the URL to File: "
- + source.toString(), e);
- }
-
- }
-
- private String getLang(InputStream in) {
- @SuppressWarnings("resource")
- Scanner scan = new Scanner(in, "UTF-8");
+ private String getLang() {
+ @SuppressWarnings("resource") // cannot close, or we loose getInput()!
+ Scanner scan = new Scanner(getInput(), "UTF-8");