@Override
    public void load() throws AccessDeniedException {
        final Local file = this.getFile();
        if(file.exists()) {
            if(log.isInfoEnabled()) {
                log.info(String.format("Found bookmarks file at %s", file));
            }
            Checksum current = Checksum.NONE;
            if(file.isFile()) {
                try {
                    current = ChecksumComputeFactory.get(HashAlgorithm.md5).compute(file.getInputStream(), new TransferStatus());
                    if(log.isDebugEnabled()) {
                        log.debug(String.format("Current checksum for %s is %s", file, current));
                    }
                }
                catch(BackgroundException e) {
                    log.warn(String.format("Failure obtaining checksum for %s", file));
                }
            }
            if(preferences.getBoolean(this.getConfiguration())) {
                // Previously imported
                final Checksum previous = new Checksum(HashAlgorithm.md5,
                    preferences.getProperty(String.format("%s.checksum", this.getConfiguration())));
                if(log.isDebugEnabled()) {
                    log.debug(String.format("Saved previous checksum %s for bookmark %s", previous, file));
                }
                if(StringUtils.isNotBlank(previous.hash)) {
                    if(previous.equals(current)) {
                        if(log.isInfoEnabled()) {
                            log.info(String.format("Skip importing bookmarks from %s with previously saved checksum %s", file, previous));
                        }
                    }
                    else {
                        if(log.isInfoEnabled()) {
                            log.info(String.format("Checksum changed for bookmarks file at %s", file));
                        }
                        // Should filter existing bookmarks. Skip import
                    }
                }
                else {
                    // Skip flagged
                    if(log.isDebugEnabled()) {
                        log.debug(String.format("Skip importing bookmarks from %s", file));
                    }
                }
            }
            else {
                // First import
                this.parse(ProtocolFactory.get(), file);
            }
            // Save last checksum
            if(current != null) {
                preferences.setProperty(String.format("%s.checksum", this.getConfiguration()), current.hash);
            }
        }
        else {
            if(log.isInfoEnabled()) {
                log.info(String.format("No bookmarks file at %s", file));
            }
        }
        // Flag as imported
        super.load();
    }
@Test
    public void testLoad() throws Exception {
        final Local source = new Local(System.getProperty("java.io.tmpdir"), new AlphanumericRandomStringService().random());
        LocalTouchFactory.get().touch(source);
        IOUtils.write(RandomUtils.nextBytes(1000), source.getOutputStream(false));
        final AtomicBoolean r = new AtomicBoolean();
        final ThirdpartyBookmarkCollection c = new ThirdpartyBookmarkCollection() {
            @Override
            public String getName() {
                return StringUtils.EMPTY;
            }

            @Override
            public Local getFile() {
                return source;
            }

            @Override
            protected void parse(final ProtocolFactory protocols, final Local file) {
                this.add(new Host(new TestProtocol()));
                r.set(true);
            }

            @Override
            public String getBundleIdentifier() {
                return "t";
            }
        };
        c.load();
        assertTrue(r.get());
        assertEquals(0, c.iterator().next().compareTo(new Host(new TestProtocol())));
        r.set(false);
        PreferencesFactory.get().setProperty(c.getConfiguration(), true);
        c.load();
        assertFalse(r.get());
        // Modify bookmarks file
//        IOUtils.write(new RandomStringGenerator.Builder().build().generate(1), source.getOutputStream(true));
//        c.load();
//        assertTrue(r.get());
        AbstractHostCollection bookmarks = new AbstractHostCollection() {
        };
        bookmarks.add(new Host(new TestProtocol()));
        c.filter(bookmarks);
        assertTrue(c.isEmpty());
    }