FileDocCategorySizeDatePackage
RecoverReader.javaAPI DocApache Lucene 2.1.06801Wed Feb 14 10:46:04 GMT 2007org.apache.lucene.gdata.storage.lucenestorage.recover

RecoverReader

public class RecoverReader extends Object
Recovers the written object from the harddisc
author
Simon Willnauer

Fields Summary
private static final Log
LOG
private RecoverStrategy
strategy
Constructors Summary
protected RecoverReader()

 
     
        this.strategy = new RecoverStrategy();
    
Methods Summary
public java.util.ListrecoverEntries(java.io.BufferedReader reader)

param
reader
return
throws
IOException

        List<StorageEntryWrapper> actionList = new ArrayList<StorageEntryWrapper>();
        this.strategy = new RecoverStrategy();
        String input = null;
        String metaData = null;
        String entryData = null;
        while((input=reader.readLine())!= null){
            if(metaData == null){
                metaData = input;
                continue;
            }
            if(input.equals(RecoverWriter.STORAGE_OPERATION_SEPARATOR)){
                try{
                actionList.add(this.strategy.recover(metaData,entryData));
                }catch (RecoverException e) {
                  LOG.error("Skipping recover entry for metadata: "+metaData,e);
                }
                this.strategy = new RecoverStrategy();
                metaData = null;
                entryData = null;
             continue;   
            }
            if(entryData == null){
                entryData = input;
            }
            
        }
        
        
        
        return actionList;