package org.zoneproject.extractor.rssreader;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import org.zoneproject.extractor.utils.Database;
import org.zoneproject.extractor.utils.Item;
import org.zoneproject.extractor.utils.Prop;
import org.zoneproject.extractor.utils.VirtuosoDatabase;


/*
 * #%L
 * ZONE-RSSreader
 * %%
 * Copyright (C) 2012 ZONE-project
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * #L%
 */
public class DownloadNewsThread extends Thread  {
    private String source;
    private static final org.apache.log4j.Logger  logger = org.apache.log4j.Logger.getLogger(App.class);

    public DownloadNewsThread(String source) {
      this.source = source;
    }
    public void run() {
        //try {Thread.currentThread().sleep(5000);} catch (InterruptedException ex1) {}
        
        //Starting rss downloading
        ArrayList<Item> items = RSSGetter.getFlux(source);

        //Cleaning flow with already analysed items
        Database.verifyItemsList(items);

        //Printing result items
        //for(int i=0; i< items.size();i++)logger.info("\n"+items.get(i));
        
        //saving to 4Store database
        Database.addItems(items);     
        logger.info("["+items.size()+"] Done for source: "+source);
  }
}

@@ -1086,32 +1086,37 @@
 c class Download
+Lasts
 NewsThread exten
@@ -1132,35 +1132,8 @@
   %7B%0A
-    private String source;%0A
     
@@ -1253,16 +1253,21 @@
 Download
+Lasts
 NewsThre
@@ -1273,243 +1273,133 @@
 ead(
-String source) %7B%0A      this.source = source;%0A    %7D%0A    public void run() %7B%0A        //try %7BThread.currentThread().sleep(5000);%7D catch (InterruptedException ex1) %7B%7D%0A        %0A        //Starting rss downloading%0A        ArrayList%3CItem%3E item
+) %7B%0A    %7D%0A    public void run() %7B%0A        String lastRss = %22%22;%0A        while(true)%7B%0A            %0A            String %5B%5D source
 s = 
@@ -1415,31 +1415,35 @@
 .get
-Flux(source
+LastsSources(100
 );%0A
-%0A
         
 //Cl
@@ -1442,198 +1442,167 @@
     
-//Cleaning flow with already analysed items%0A        Database.verifyItemsList(items);%0A%0A        //Printing result items%0A        //for(int i=0; i%3C items.size();i++)logger.info(%22%5Cn%22+items.get(i)
+    for(String cur: sources)%7B%0A                if(cur == lastRss)%7B%0A                    break;%0A                %7D%0A                logger.info(%22QUICKANNOTATE:%22+cur
 );%0A 
@@ -1608,25 +1608,24 @@
         
-%0A
         
 //saving
@@ -1620,142 +1620,176 @@
     
-//saving to 4Store database%0A        Database.addItems(items);     %0A        logger.info(%22%5B%22+items.size()+%22%5D Done for source: %22+source);
+new DownloadNewsThread(cur).start();%0A            %7D%0A            lastRss = sources%5B0%5D;%0A            try%7BThread.currentThread().sleep(1000);%7Dcatch(Exception ie)%7B%7D%0A        %7D
 %0A  %7D

add the code in order to make quick annotation on new items