// Path: app/src/main/java/com/nicolasbrailo/vlcfreemote/model/Server.java
// public class Server {
//     public final String ip;
//     public String displayName;
//     private final Integer sshPort;
//     public final Integer vlcPort;
//     private String password;
//     private String lastPath;
// 
//     public Server(String ip, Integer vlcPort, Integer sshPort) {
//         this.ip = ip;
//         this.vlcPort = vlcPort;
//         this.sshPort = sshPort;
//         this.password = "";
//         this.displayName = null;
//     }
// 
//     public void setDisplayName(final String name) {
//         this.displayName = name;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getFullDisplayName() {
//         if (displayName != null) {
//             return displayName + " (" + ip + ")";
//         } else {
//             return ip + ":" + vlcPort;
//         }
//     }
// 
//     public void setPassword(final String password) {
//         this.password = password;
//     }
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setLastPath(String lastPath) { this.lastPath = lastPath; }
//     public String getLastPath() { return this.lastPath; }
// }


import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteConstraintException;
import com.nicolasbrailo.vlcfreemote.model.Server;
import java.util.ArrayList;
import java.util.List;
package com.nicolasbrailo.vlcfreemote.local_settings;





public class Bookmarks extends LocalSettings {

    private static final int DB_VERSION = 1;
    private static final String DB_NAME = "bookmarks.db";
    private static final String TABLE_NAME = "bookmarks";
    private static final String COLUMN_IP = "ip";
    private static final String COLUMN_VLCPORT = "port";
    private static final String COLUMN_PATH = "path";

    public Bookmarks(Context context) {
        super(context, DB_NAME, DB_VERSION);
    }

    @Override
    protected String getDeleteTableSQL() {
        return "DROP TABLE IF EXISTS " + TABLE_NAME;
    }

    @Override
    protected String getCreateTableSQL() {
        return "CREATE TABLE " + TABLE_NAME + " (" +
                    COLUMN_IP      + " VARCHAR(15), " +
                    COLUMN_VLCPORT + " INTEGER, " +
                    COLUMN_PATH    + " TEXT, " +
                    "PRIMARY KEY ("+ COLUMN_IP + "," + COLUMN_VLCPORT + ", " + COLUMN_PATH + ") " +
                " )";
    }

// Path: app/src/main/java/com/nicolasbrailo/vlcfreemote/model/Server.java
// public class Server {
//     public final String ip;
//     public String displayName;
//     private final Integer sshPort;
//     public final Integer vlcPort;
//     private String password;
//     private String lastPath;
// 
//     public Server(String ip, Integer vlcPort, Integer sshPort) {
//         this.ip = ip;
//         this.vlcPort = vlcPort;
//         this.sshPort = sshPort;
//         this.password = "";
//         this.displayName = null;
//     }
// 
//     public void setDisplayName(final String name) {
//         this.displayName = name;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public String getFullDisplayName() {
//         if (displayName != null) {
//             return displayName + " (" + ip + ")";
//         } else {
//             return ip + ":" + vlcPort;
//         }
//     }
// 
//     public void setPassword(final String password) {
//         this.password = password;
//     }
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setLastPath(String lastPath) { this.lastPath = lastPath; }
//     public String getLastPath() { return this.lastPath; }
// }


// Path: app/src/main/java/com/nicolasbrailo/vlcfreemote/local_settings/Bookmarks.java
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteConstraintException;
import com.nicolasbrailo.vlcfreemote.model.Server;
import java.util.ArrayList;
import java.util.List;

package com.nicolasbrailo.vlcfreemote.local_settings;





public class Bookmarks extends LocalSettings {

    private static final int DB_VERSION = 1;
    private static final String DB_NAME = "bookmarks.db";
    private static final String TABLE_NAME = "bookmarks";
    private static final String COLUMN_IP = "ip";
    private static final String COLUMN_VLCPORT = "port";
    private static final String COLUMN_PATH = "path";

    public Bookmarks(Context context) {
        super(context, DB_NAME, DB_VERSION);
    }

    @Override
    protected String getDeleteTableSQL() {
        return "DROP TABLE IF EXISTS " + TABLE_NAME;
    }

    @Override
    protected String getCreateTableSQL() {
        return "CREATE TABLE " + TABLE_NAME + " (" +
                    COLUMN_IP      + " VARCHAR(15), " +
                    COLUMN_VLCPORT + " INTEGER, " +
                    COLUMN_PATH    + " TEXT, " +
                    "PRIMARY KEY ("+ COLUMN_IP + "," + COLUMN_VLCPORT + ", " + COLUMN_PATH + ") " +
                " )";
    }

    public void addBookmark(final Server srv, final String path) {