forked from JabRef/jabref
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quick sketch of how the CSVreader would read in data and use it in au…
…tomated automated test. The examples are written in the tests methods. This is related to issue JabRef#6189.
- Loading branch information
David Yu
authored and
David Yu
committed
Mar 8, 2021
1 parent
6b16f6f
commit 621c036
Showing
2 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/org/jabref/logic/journals/JournalStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jabref.logic.journals; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
public class JournalStatistics { | ||
private Path pathToCSV; | ||
|
||
public JournalStatistics(Path path) { | ||
this.pathToCSV = path; | ||
} | ||
|
||
public boolean getTitleByISSN(int ISSN) throws IOException { | ||
String readString = Files.readString(pathToCSV); | ||
String[] strings = readString.split(";"); | ||
|
||
for (String s: | ||
strings) { | ||
if (s.contains(String.valueOf(ISSN))) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters