1 /* 2 * Copyright (C) The Apache Software Foundation. All rights reserved. 3 * 4 * This software is published under the terms of the Apache Software License 5 * version 1.1, a copy of which has been included with this distribution in 6 * the LICENSE.txt file. 7 */ 8 package org.apache.avalon.excalibur.vfs; 9 10 import java.io.InputStream; 11 import java.io.IOException; 12 13 /** 14 * Accessor for implementations of VFS. 15 * 16 * @author <a HREF="mailto:peter@apache.org">Peter Donald</a> 17 */ 18 public interface VFileAccessor 19 { 20 /** 21 * Get size of resource in bytes. 22 * 23 * @param resource the resource designator 24 * @return the size of resource in bytes 25 */ 26 long getSize( VFile file, Object resource ); 27 28 /** 29 * Get InputStream for resource. 30 * 31 * @param resource the resource designator 32 * @return the input stream 33 * @exception IOException if an error occurs 34 */ 35 InputStream getInputStream( VFile file, Object resource ) 36 throws IOException; 37 } 38