2 import java
.lang
.reflect
.Array
;
6 public static final void main(String
[] args
) {
7 TagDatabase td
= TagDatabase
.getInstance();
8 File tdfile
= new File("rockbox.tagdb");
9 // RuntimeDatabase rd = RuntimeDatabase.getInstance();
11 String arg
,path
= null;
13 while (i
< args
.length
) {
15 if (arg
.equals("--dirisnotalbumname")) {
16 td
.dirisalbumname
=false;
18 else if(arg
.equals("--dirisalbum")) {
21 else if(arg
.equals("--dontshowduplicates")) {
22 td
.showduplicates
=false;
24 else if(arg
.equals("--strip")) {
28 System
.err
.println("--strip requires a path");
32 else if(arg
.equals("--add")) {
36 System
.err
.println("--add requires a path");
42 System
.err
.println("you can't specify more than one path!");
48 if (i
!= args
.length
||path
==null) {
49 System
.out
.println("Usage: SongDB [--showduplicates] [--strip <directory>] [--add <directory>] [--dirisnotalbumname] [--dirisalbum] <directory>");
52 if(tdfile
.exists()&&!tdfile
.canWrite()) {
53 System
.out
.println("rockbox.tagdb is not writable.");
57 tdfile
.createNewFile();
60 System
.out
.println("Error while trying to create rockbox.tagdb: "+e
.getMessage());
63 td
.add(new File(path
));
67 td
.writeDatabase(new File("rockbox.tagdb"));
68 // rd.writeDatabase(new File("rockbox.rundb"));
70 catch(IOException e
) {
71 System
.out
.println(e
);