private void parse(final ProtocolFactory protocols, NSDictionary item) { final PlistDeserializer bookmark = new PlistDeserializer(item); final List<NSDictionary> children = bookmark.listForKey("Children"); if(null != children) { for(NSDictionary child : children) { this.parse(protocols, child); } return; } final String url = bookmark.stringForKey("URL"); if(StringUtils.isBlank(url)) { // Possibly a folder return; } final Host host = new HostParser(protocols).get(url); if(StringUtils.isBlank(host.getHostname())) { // Possibly file:// return; } final String title = bookmark.stringForKey("Title"); if(StringUtils.isNotBlank(title)) { host.setNickname(title); } this.add(host); } }
@Override protected void parse(final ProtocolFactory protocols, final Local file) { NSDictionary serialized = NSDictionary.dictionaryWithContentsOfFile(file.getAbsolute()); if(null == serialized) { log.error("Invalid bookmark file:" + file); return; } List<NSDictionary> items = new PlistDeserializer(serialized).listForKey("Children"); if(null == items) { log.error("Invalid bookmark file:" + file); return; } for(NSDictionary item : items) { this.parse(protocols, item); } }
public ImporterBackgroundAction(final AbstractHostCollection bookmarks, final CountDownLatch lock) { this(bookmarks, lock, Arrays.asList( new Transmit4BookmarkCollection(), new FilezillaBookmarkCollection(), new FetchBookmarkCollection(), new FlowBookmarkCollection(), new InterarchyBookmarkCollection(), new CrossFtpBookmarkCollection(), new FireFtpBookmarkCollection(), new Expandrive3BookmarkCollection(), new Expandrive4BookmarkCollection(), new Expandrive5BookmarkCollection(), new Expandrive6BookmarkCollection())); }