1 28 29 package com.caucho.vfs; 30 31 import java.util.Map ; 32 33 36 public class JarScheme extends FilesystemPath { 37 JarScheme(String path) 38 { 39 super(null, "/", "/"); 40 } 41 42 45 protected Path schemeWalk(String userPath, 46 Map <String ,Object > attributes, 47 String filePath, 48 int offset) 49 { 50 int p = filePath.indexOf('!', offset); 51 String backingPath; 52 String jarPath; 53 54 if (p > 0) { 55 backingPath = filePath.substring(offset, p); 56 jarPath = filePath.substring(p + 1); 57 } 58 else { 59 backingPath = filePath.substring(offset); 60 jarPath = ""; 61 } 62 63 Path backing = Vfs.lookup(backingPath); 64 65 return JarPath.create(backing).lookup(jarPath); 66 } 67 68 public Path fsWalk(String userPath, 69 Map <String ,Object > attributes, 70 String path) 71 { 72 return schemeWalk(userPath, attributes, path, 0); 73 } 74 75 public String getScheme() 76 { 77 return "jar"; 78 } 79 } 80 | Popular Tags |