Clover Coverage Report - Maven Cloud Front Plugin 1.0.30
Coverage timestamp: Wed Nov 9 2011 21:05:10 EST
../../../../../img/srcFileCovDistChart0.png 15% of files have more coverage
20   58   8   4
4   46   0.4   5
5     1.6  
1    
 
  UpdateDirectoryThread       Line # 13 20 0% 8 29 0% 0.0
 
No Tests
 
1    package org.kuali.maven.mojo.s3;
2   
3    import static org.apache.commons.lang.StringUtils.leftPad;
4   
5    import java.io.IOException;
6    import java.util.List;
7   
8    import org.slf4j.Logger;
9    import org.slf4j.LoggerFactory;
10   
11    import com.amazonaws.AmazonServiceException;
12   
 
13    public class UpdateDirectoryThread implements Runnable {
14    final Logger logger = LoggerFactory.getLogger(UpdateDirectoryThread.class);
15   
16    UpdateDirectoryThreadContext context;
17   
 
18  0 toggle public UpdateDirectoryThread() {
19  0 this(null);
20    }
21   
 
22  0 toggle public UpdateDirectoryThread(UpdateDirectoryThreadContext context) {
23  0 super();
24  0 this.context = context;
25    }
26   
 
27  0 toggle @Override
28    public void run() {
29  0 logger.debug("[Thread-" + context.getId() + "] Starting");
30  0 int offset = context.getOffset();
31  0 int length = context.getLength();
32  0 List<UpdateDirectoryContext> list = context.getContexts();
33  0 BucketUpdater updater = context.getUpdater();
34  0 for (int i = offset; i < offset + length; i++) {
35  0 if (context.getHandler().isStopThreads()) {
36  0 break;
37    }
38  0 UpdateDirectoryContext udc = list.get(i);
39  0 try {
40  0 updater.updateDirectory(udc);
41    } catch (IOException e) {
42  0 throw new AmazonServiceException("Unexpected error", e);
43    }
44  0 logger.debug(leftPad(context.getId() + "", 2, " ") + " - " + udc.getCopyToKey());
45  0 context.getTracker().increment();
46    }
47  0 logger.debug("Thread " + context.getId() + " stopping");
48    }
49   
 
50  0 toggle public UpdateDirectoryThreadContext getContext() {
51  0 return context;
52    }
53   
 
54  0 toggle public void setContext(UpdateDirectoryThreadContext context) {
55  0 this.context = context;
56    }
57   
58    }