- protected MetaData getMeta(URL source, InputStream in) throws IOException {
- try {
- MetaData meta = InfoReader.readMeta(new File(new File(source
- .toURI()).getPath() + ".info"));
-
- // Some old .info files don't have this information...
- String test = meta.getTitle() == null ? "" : meta.getTitle();
- test += meta.getAuthor() == null ? "" : meta.getAuthor();
- test += meta.getDate() == null ? "" : meta.getDate();
- if (test.isEmpty()) {
- MetaData superMeta = super.getMeta(source, reset(in));
- if (meta.getTitle() == null || meta.getTitle().isEmpty()) {
- meta.setTitle(superMeta.getTitle());
- }
- if (meta.getAuthor() == null || meta.getAuthor().isEmpty()) {
- meta.setAuthor(superMeta.getAuthor());
- }
- if (meta.getDate() == null || meta.getDate().isEmpty()) {
- meta.setDate(superMeta.getDate());
- }
- }
-
- return meta;
-
- } catch (URISyntaxException e) {
- throw new IOException("Cannot parse URL to file: " + source, e);
- }
+ protected MetaData getMeta() throws IOException {
+ return InfoReader.readMeta(getInfoFile(), true);