/** * Read invalid JSON format. */ protected void read(final ProtocolFactory protocols, final Local file) throws AccessDeniedException { try { BufferedReader in = new BufferedReader(new InputStreamReader(file.getInputStream(), Charset.forName("UTF-8"))); try { String l; while((l = in.readLine()) != null) { Matcher array = Pattern.compile("\\[(.*?)\\]").matcher(l); while(array.find()) { Matcher entries = Pattern.compile("\\{(.*?)\\}").matcher(array.group(1)); while(entries.find()) { final String entry = entries.group(1); this.read(protocols, entry); } } } } finally { IOUtils.closeQuietly(in); } } catch(IOException e) { throw new AccessDeniedException(e.getMessage(), e); } }
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())); }
this.add(current);
/** * FireFTP settings are in Firefox/Profiles/.*\.default/fireFTPsites.dat */ @Override protected void parse(final ProtocolFactory protocols, final Local folder) throws AccessDeniedException { for(Local settings : folder.list().filter(new NullFilter<Local>() { @Override public boolean accept(Local file) { return file.isDirectory(); } })) { for(Local child : settings.list().filter(new NullFilter<Local>() { @Override public boolean accept(Local file) { if(file.isFile()) { return "fireFTPsites.dat".equals(file.getName()); } return false; } })) { this.read(protocols, child); } } }