@Override
    protected void parse(final ProtocolFactory protocols, final Local file) throws AccessDeniedException {
        final NSDictionary serialized = NSDictionary.dictionaryWithContentsOfFile(file.getAbsolute());
        if(null == serialized) {
            throw new LocalAccessDeniedException(String.format("Invalid bookmark file %s", file));
        }
        final List<NSDictionary> array = new PlistDeserializer(serialized).listForKey("CustomPluginSettings");
        if(null == array) {
            log.warn("Missing key CustomPluginSettings");
            return;
        }
        for(NSDictionary dict : array) {
            final PlistDeserializer bookmark = new PlistDeserializer(dict);
            final String identifier = bookmark.stringForKey("MountFSClassName");
            if(StringUtils.isBlank(identifier)) {
                log.warn("Missing key MountFSClassName");
                continue;
            }
            final Protocol protocol;
            switch(identifier) {
                case "FtpConnection":
                    protocol = protocols.forType(Protocol.Type.ftp);
                    break;
                case "WebDAVConnection":
                    protocol = protocols.forType(Protocol.Type.dav);
                    break;
                case "OpenStackConnection":
                    protocol = protocols.forType(Protocol.Type.swift);
                    break;
                case "BBConnection":
                    protocol = protocols.forType(Protocol.Type.b2);
                    break;
                case "S3Connection":
                    protocol = protocols.forType(Protocol.Type.s3);
                    break;
                case "DropboxConnection":
                    protocol = protocols.forType(Protocol.Type.dropbox);
                    break;
                case "GDriveConnection":
                    protocol = protocols.forType(Protocol.Type.googledrive);
                    break;
                default:
                    protocol = null;
                    break;

            }
            if(null == protocol) {
                log.warn(String.format("Unable to determine protocol for %s", identifier));
                continue;
            }
            final NSDictionary details = bookmark.objectForKey("MountFSOptions");
            if(null == details) {
                continue;
            }
            final PlistDeserializer options = new PlistDeserializer(details);
            final String hostname = options.stringForKey("host");
            if(StringUtils.isBlank(hostname)) {
                continue;
            }
            final Host host = new Host(protocol, hostname, new Credentials(options.stringForKey("login")));
            host.setNickname(bookmark.stringForKey("MountFSLabel"));
            host.setDefaultPath(options.stringForKey("remotePath"));
            this.add(host);
        }
    }
@Test
    public void testParse() throws Exception {
        CloudMounterBookmarkCollection c = new CloudMounterBookmarkCollection();
        assertEquals(0, c.size());
        c.parse(new ProtocolFactory(new HashSet<>(Arrays.asList(
            new TestProtocol(Scheme.ftp),
            new TestProtocol(Scheme.ftps),
            new TestProtocol(Scheme.sftp)
        ))), new Local("src/test/resources/com.eltima.cloudmounter.plist"));
        assertEquals(2, c.size());
    }