Coverage Report - org.webslinger.commons.vfs.cow.COWCOWStateOperation
 
Classes in this File Line Coverage Branch Coverage Complexity
COWCOWStateOperation
69%
9/13
N/A
0
 
 1  
 package org.webslinger.commons.vfs.cow;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.Collection;
 5  
 import java.util.Collections;
 6  
 
 7  
 import org.apache.commons.vfs.FileName;
 8  
 import org.apache.commons.vfs.FileSystemException;
 9  
 
 10  
 import org.webslinger.commons.vfs.operations.COWStateOperation;
 11  
 
 12  
 public class COWCOWStateOperation<T extends COWFileObject> implements COWStateOperation {
 13  
     protected final COWFileSystem fs;
 14  
     protected final FileName name;
 15  
 
 16  49
     protected COWCOWStateOperation(T file) {
 17  49
         fs = file.getFileSystem();
 18  49
         name = file.getName();
 19  49
     }
 20  
 
 21  
     public final void process() throws FileSystemException {
 22  0
         throw new UnsupportedOperationException();
 23  
     }
 24  
 
 25  
     public void clear() throws FileSystemException {
 26  6
         fs.getCOWEntry(name.getPath()).clear();
 27  6
     }
 28  
 
 29  
     public Collection<String> getBases() throws FileSystemException {
 30  24
         return fs.getCOWEntry(name.getPath()).getBases();
 31  
     }
 32  
 
 33  
     public boolean addBase(String relative) throws FileSystemException {
 34  13
         return fs.getCOWEntry(name.getPath()).addBase(relative);
 35  
     }
 36  
 
 37  
     public boolean removeBase(String relative) throws FileSystemException {
 38  6
         return fs.getCOWEntry(name.getPath()).removeBase(relative);
 39  
     }
 40  
 
 41  
     public boolean isDeleted() throws FileSystemException {
 42  0
         return fs.getCOWEntry(name.getPath()).isDeleted();
 43  
     }
 44  
 
 45  
     public void setDeleted(boolean deleted) throws FileSystemException {
 46  0
         fs.getCOWEntry(name.getPath()).setDeleted(deleted);
 47  0
     }
 48  
 }