@Override
    protected void parse(final ProtocolFactory protocols, final Local file) throws AccessDeniedException {
        try {
            final JsonReader reader = new JsonReader(new InputStreamReader(file.getInputStream(), StandardCharsets.UTF_8));
            reader.beginArray();
            String url;
            String user;
            boolean ssl;
            Protocol protocol;
            while(reader.hasNext()) {
                reader.beginObject();
                boolean skip = false;
                url = null;
                ssl = false;
                protocol = null;
                user = null;
                while(reader.hasNext()) {
                    final String name = reader.nextName();
                    switch(name) {
                        case "url":
                            url = this.readNext(name, reader);
                            if(StringUtils.isBlank(url)) {
                                skip = true;
                            }
                            break;
                        case "ssl":
                            ssl = reader.nextBoolean();
                            break;
                        case "user":
                            user = this.readNext(name, reader);
                            break;
                        case "type":
                            final String type = this.readNext(name, reader);
                            switch(type) {
                                case "google_cloud_storage":
                                    protocol = protocols.forType(Protocol.Type.googlestorage);
                                    break;
                                case "gdrive":
                                    protocol = protocols.forType(Protocol.Type.googledrive);
                                    break;
                                default:
                                    protocol = protocols.forName(type);
                            }
                            break;

                        default:
                            log.warn(String.format("Ignore property %s", name));
                            reader.skipValue();
                            break;
                    }
                }
                reader.endObject();
                if(!skip && protocol != null && StringUtils.isNotBlank(user)) {
                    if(ssl) {
                        switch(protocol.getType()) {
                            case ftp:
                                protocol = protocols.forScheme(Scheme.ftps);
                                break;
                            case dav:
                                protocol = protocols.forScheme(Scheme.davs);
                                break;
                        }
                    }
                    try {
                        this.add(new HostParser(protocols, protocol).get(url));
                    }
                    catch(HostParserException e) {
                        log.warn(e);
                    }
                }
            }
            reader.endArray();
        }
        catch(IllegalStateException | IOException e) {
            throw new LocalAccessDeniedException(e.getMessage(), e);
        }
    }
@Test
    public void testParse() throws AccessDeniedException {
        NetDrive2BookmarkCollection c = new NetDrive2BookmarkCollection();
        assertEquals(0, c.size());
        c.parse(new ProtocolFactory(Collections.singleton(new TestProtocol(Scheme.sftp))), new Local("src/test/resources/drives.dat"));
        assertEquals(1, c.size());
    }