Coverage Report - com.aragost.javahg.internals.JavaHgMercurialExtension
 
Classes in this File Line Coverage Branch Coverage Complexity
JavaHgMercurialExtension
100%
7/7
25%
1/4
1.5
 
 1  
 package com.aragost.javahg.internals;
 2  
 
 3  
 import java.io.File;
 4  
 import java.io.IOException;
 5  
 
 6  
 import com.aragost.javahg.MercurialExtension;
 7  
 
 8  
 /**
 9  
  * Extension class to load the JavaHg specific Mercurial extension
 10  
  */
 11  2
 public class JavaHgMercurialExtension extends MercurialExtension {
 12  
 
 13  
     private File pythonFile;
 14  
 
 15  
     @Override
 16  
     public String getName() {
 17  218
         return "javahg";
 18  
     }
 19  
 
 20  
     public String getResourceName() {
 21  2
         return "/" + getName() + ".py";
 22  
     }
 23  
 
 24  
     @Override
 25  
     public String getPath() {
 26  404
         return this.pythonFile.getAbsolutePath();
 27  
     }
 28  
 
 29  
     @Override
 30  
     public void initialize() throws IOException {
 31  2
         if (this.pythonFile == null || !this.pythonFile.exists()) {
 32  2
             this.pythonFile = Utils.resourceAsFile(getResourceName());
 33  
         }
 34  2
     }
 35  
 
 36  
 }