View Javadoc

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;
15  
16  import java.io.IOException;
17  import java.io.InputStream;
18  
19  /**
20   * Information about and access to a location that contains a class or a resource.
21   * <br/>
22   * IMPORTANT: Do not hold onto instances.  There maybe open file or network resources associated with these instances.
23   */
24  public interface ResourceFile {
25  	/**
26  	 * Get the relative file name;
27  	 * @return The resource name relative to the ClassPathElement base
28  	 */
29  	String getFileName();
30  	
31  	/**
32  	 * Get the stream of bytes for the resource.
33  	 * 
34  	 * @return The InputStream to read resource bytes.  This stream should be closed when all bytes have been read.
35  	 */
36  	InputStream getBytes() throws IOException;
37  }