1 16 package org.apache.commons.vfs.provider; 17 18 import org.apache.commons.vfs.FileObject; 19 import org.apache.commons.vfs.FileSystemException; 20 import org.apache.commons.vfs.FileSystemOptions; 21 22 27 public abstract class CompositeFileProvider extends AbstractFileProvider 28 { 29 public CompositeFileProvider() 30 { 31 super(); 32 } 33 34 37 protected abstract String [] getSchemes(); 38 39 42 public FileObject findFile(final FileObject baseFile, 43 final String uri, 44 final FileSystemOptions fileSystemOptions) 45 throws FileSystemException 46 { 47 StringBuffer buf = new StringBuffer (80); 48 49 UriParser.extractScheme(uri, buf); 50 51 String [] schemes = getSchemes(); 52 for (int iterSchemes = 0; iterSchemes < schemes.length; iterSchemes++) 53 { 54 buf.insert(0, ":"); 55 buf.insert(0, schemes[iterSchemes]); 56 } 57 58 FileObject fo = getContext().getFileSystemManager().resolveFile(buf.toString(), fileSystemOptions); 59 return fo; 60 } 61 } 62 | Popular Tags |