public class BibliographyFileReader extends Object
ItemDataProvider that holds all
bibliography items read from the file.| Modifier and Type | Class and Description |
|---|---|
static class |
BibliographyFileReader.FileFormat
Supported file formats for bibliography files
|
| Constructor and Description |
|---|
BibliographyFileReader() |
| Modifier and Type | Method and Description |
|---|---|
BibliographyFileReader.FileFormat |
determineFileFormat(BufferedInputStream bis,
String filename)
Reads the first bytes of the given input stream and tries to
determine the file format.
|
BibliographyFileReader.FileFormat |
determineFileFormat(File bibfile)
Reads the first 100 KB of the given bibliography file and tries
to determine the file format
|
ItemDataProvider |
readBibliographyFile(File bibfile)
Reads all items from an input bibliography file and returns a provider
serving these items
|
ItemDataProvider |
readBibliographyFile(InputStream bibstream,
BibliographyFileReader.FileFormat format)
Reads all items from an input stream using the given file format and
returns a provider serving these items.
|
ItemDataProvider |
readBibliographyFile(InputStream bibstream,
String filename)
Reads all items from an input stream and returns a provider
serving these items.
|
public ItemDataProvider readBibliographyFile(File bibfile) throws FileNotFoundException, IOException
bibfile - the input fileFileNotFoundException - if the input file was not foundIOException - if the input file could not be readpublic ItemDataProvider readBibliographyFile(InputStream bibstream, String filename) throws IOException
bibstream - the input streamfilename - the name of the input file (can be null if you don't
know the name)IOException - if the input stream could not be readpublic ItemDataProvider readBibliographyFile(InputStream bibstream, BibliographyFileReader.FileFormat format) throws IOException
bibstream - the input streamformat - the bibliography file formatIOException - if the input stream could not be readpublic BibliographyFileReader.FileFormat determineFileFormat(File bibfile) throws FileNotFoundException, IOException
bibfile - the input fileBibliographyFileReader.FileFormat.UNKNOWN if the format
could not be determined)FileNotFoundException - if the input file was not foundIOException - if the input file could not be readpublic BibliographyFileReader.FileFormat determineFileFormat(BufferedInputStream bis, String filename) throws IOException
bis - a buffered input stream that supports the mark and reset
methodsfilename - the name of the input file (can be null if you don't
know the name)BibliographyFileReader.FileFormat.UNKNOWN if the format
could not be determined)IOException - if the input stream could not be read