Coverage Report - org.apache.commons.classscan.builtin.FileResourceFile
 
Classes in this File Line Coverage Branch Coverage Complexity
FileResourceFile
0%
0/6
N/A
1
 
 1  
 /*
 2  
  * Licensed under the Apache License, Version 2.0 (the "License");
 3  
  * you may not use this file except in compliance with the License.
 4  
  * You may obtain a copy of the License at
 5  
  *
 6  
  *      http://www.apache.org/licenses/LICENSE-2.0
 7  
  *
 8  
  * Unless required by applicable law or agreed to in writing, software
 9  
  * distributed under the License is distributed on an "AS IS" BASIS,
 10  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 11  
  * See the License for the specific language governing permissions and
 12  
  * limitations under the License.
 13  
  */
 14  
 package org.apache.commons.classscan.builtin;
 15  
 
 16  
 import java.io.BufferedInputStream;
 17  
 import java.io.File;
 18  
 import java.io.FileInputStream;
 19  
 import java.io.IOException;
 20  
 import java.io.InputStream;
 21  
 
 22  
 import org.apache.commons.classscan.ResourceFile;
 23  
 
 24  
 public class FileResourceFile implements ResourceFile {
 25  
 
 26  
         private final File location;
 27  
         private final String relativePath;
 28  
 
 29  0
         public FileResourceFile(File location, String relativePath) {
 30  0
                 this.location = location;
 31  0
                 this.relativePath = relativePath;
 32  0
         }
 33  
 
 34  
         @Override
 35  
         public String getFileName() {
 36  0
                 return relativePath;
 37  
         }
 38  
 
 39  
         @Override
 40  
         public InputStream getBytes() throws IOException {
 41  0
         return new BufferedInputStream(new FileInputStream(location));
 42  
         }
 43  
 }