1 28 29 package com.caucho.vfs; 30 31 import java.util.Map ; 32 33 public class StringPath extends Path { 34 private String _string; 35 36 public StringPath(String string) 37 { 38 super(null); 39 40 _string = string; 41 _schemeMap = SchemeMap.getNullSchemeMap(); 42 } 43 44 public Path schemeWalk(String userPath, Map <String ,Object > attributes, 45 String path, int offset) 46 { 47 return this; 48 } 49 50 public String getURL() 51 { 52 return "string:"; 53 } 54 55 public String getScheme() 56 { 57 return "string"; 58 } 59 60 public String getPath() 61 { 62 return "string:"; 63 } 64 65 public Path lookupImpl(String userPath, Map <String ,Object > newAttributes) 66 { 67 return this; 68 } 69 70 public boolean exists() 71 { 72 return true; 73 } 74 75 public boolean canRead() 76 { 77 return true; 78 } 79 80 public StreamImpl openReadImpl() 81 { 82 return new StringStream(_string); 83 } 84 } 85 | Popular Tags |