Skip to content

Commit

Permalink
citavi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psyren99 committed Sep 7, 2024
1 parent 1545e8d commit f73da89
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,25 @@
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import javax.xml.stream.events.XMLEvent;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter;
import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter;
import org.jabref.logic.importer.fileformat.medline.ArticleId;
import org.jabref.logic.importer.fileformat.medline.OtherId;
import org.jabref.logic.importer.Importer;
import org.jabref.logic.importer.Parser;
import org.jabref.logic.importer.ParserResult;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.util.StandardFileType;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.FieldFactory;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.field.UnknownField;
import org.jabref.model.entry.types.EntryType;
import org.jabref.model.entry.types.IEEETranEntryType;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.model.strings.StringUtil;

Expand Down Expand Up @@ -105,8 +99,8 @@ public boolean isRecognizedFormat(Path filePath) throws IOException {
try (BufferedReader reader = getReaderFromZip(filePath)) {
String str;
int i = 0;
while (((str = reader.readLine()) != null)) {
if (str.toLowerCase(Locale.ROOT).contains("CitaviExchangeData")){
while ((str = reader.readLine()) != null) {
if (str.toLowerCase(Locale.ROOT).contains("citaviexchangedata")) {
return true;
}
i++;
Expand Down Expand Up @@ -139,7 +133,7 @@ public ParserResult importDatabase(Path filePath) throws IOException {
} else {
return ParserResult.fromErrorMessage("File does not start with xml tag.");
}
} catch(XMLStreamException e) {
} catch (XMLStreamException e) {
LOGGER.debug("could not parse document", e);
return ParserResult.fromError(e);
}
Expand Down

0 comments on commit f73da89

Please sign in to comment.