From 6a24c6080dee7331fd7a93c520a5b6832164893d Mon Sep 17 00:00:00 2001
From: James Elliott Construct a database access instance from the specified recordbox export file.
* The file can obtained either from the SD or USB media, or directly from a player
- * using {@link FileFetcher#fetch(InetAddress, String, String, File)}.
Be sure to call {@link #close()} when you are done using the parsed database * to close the underlying file or users will be unable to unmount the drive holding @@ -46,9 +52,28 @@ public class Database implements Closeable { */ @API(status = API.Status.STABLE) public Database(File sourceFile) throws IOException { - // TODO add arity where we can set isExt. + this(sourceFile, false); + } + + /** + *
Construct a database access instance from the specified recordbox export file. + * The file can obtained either from the SD or USB media, or directly from a player + * using {@link FileFetcher#fetch(InetAddress, String, String, File)}.
+ * + *Be sure to call {@link #close()} when you are done using the parsed database + * to close the underlying file or users will be unable to unmount the drive holding + * it until they quit your program.
+ * + * @param sourceFile an export.pdb or exportExt.pdb file + * @param isExportExt indicates which type of file is to be parsed + * + * @throws IOException if there is a problem reading the file + */ + @API(status = API.Status.EXPERIMENTAL) + public Database(File sourceFile, boolean isExportExt) throws IOException { this.sourceFile = sourceFile; - pdb = new RekordboxPdb(new RandomAccessFileKaitaiStream(sourceFile.getAbsolutePath()), false); + this.isExportExt = isExportExt; + pdb = new RekordboxPdb(new RandomAccessFileKaitaiStream(sourceFile.getAbsolutePath()), isExportExt); final SortedMap