Coverage Report - org.webslinger.commons.vfs.cow.COWFileObject
 
Classes in this File Line Coverage Branch Coverage Complexity
COWFileObject
82%
9/11
100%
2/2
0
 
 1  
 package org.webslinger.commons.vfs.cow;
 2  
 
 3  
 import java.io.IOException;
 4  
 import java.lang.ref.SoftReference;
 5  
 
 6  
 import org.apache.commons.vfs.FileName;
 7  
 import org.apache.commons.vfs.FileObject;
 8  
 import org.apache.commons.vfs.FileSystemException;
 9  
 
 10  
 import org.webslinger.commons.vfs.GenerationalFileObject;
 11  
 
 12  
 public class COWFileObject extends GenerationalFileObject<FileName, COWFileObject, COWFileSystem.COWResolution, COWFileSystem> {
 13  
     private SoftReference<FileObject> parentLayerFile;
 14  
 
 15  
     public COWFileObject(FileName name, COWFileSystem cfs) {
 16  114
         super(name, cfs);
 17  114
     }
 18  
 
 19  
     FileObject getFile() throws FileSystemException {
 20  55
         return getFile(false);
 21  
     }
 22  
 
 23  
     synchronized FileObject getParentLayerFile() throws FileSystemException {
 24  
         FileObject parentFile;
 25  368
         if (parentLayerFile != null) {
 26  290
             parentFile = parentLayerFile.get();
 27  290
             if (parentFile != null) return parentFile;
 28  
         }
 29  78
         parentFile = getFileSystem().getParentLayer().resolveFile(getName().getPath().substring(1));
 30  78
         parentLayerFile = new SoftReference<FileObject>(parentFile);
 31  78
         return parentFile;
 32  
     }
 33  
 
 34  
     public FileObject[] getAllFiles() throws FileSystemException {
 35  0
         return getResolution(false).getFiles();
 36  
     }
 37  
 
 38  
     public COWEntry getCOWEntry() throws IOException {
 39  0
         return fs.getCOWEntry(getName().getPath());
 40  
     }
 41  
 }