예제 #1
0
 // Break the line at commas, return a map of the resulting strings
 // broken at equals sign.  (<i>Ie</i>, name value pairs.)
 Map getRow(String line) {
   Map map = new HashMap();
   for (Iterator iter = StringUtil.breakAt(line, ',').iterator(); iter.hasNext(); ) {
     String item = (String) iter.next();
     List pair = StringUtil.breakAt(item, '=');
     map.put(pair.get(0), pair.get(1));
   }
   return map;
 }
 /** iterate over the mime-types makeRow for each */
 private List getRows(CrawlerStatus status, String key) {
   Collection mimeTypes = status.getMimeTypes();
   List rows = new ArrayList();
   if (mimeTypes != null) {
     String mimeType;
     for (Iterator it = mimeTypes.iterator(); it.hasNext(); ) {
       mimeType = (String) it.next();
       rows.add(makeRow(status, mimeType, key));
     }
   }
   return rows;
 }