1 28 29 package com.caucho.vfs; 30 31 import java.io.IOException ; 32 import java.util.Map ; 33 34 public class ConstPath extends Path 35 { 36 private String _scheme = "const"; 37 private String _path = ""; 38 39 StreamImpl _stream; 40 41 public ConstPath(Path root, StreamImpl stream) 42 { 43 super(root); 44 _stream = stream; 45 } 46 47 protected Path schemeWalk(String userPath, Map <String ,Object > attributes, 48 String path, int offset) 49 { 50 return this; 51 } 52 53 public String getURL() 54 { 55 return getScheme() + ":" + getPath(); 56 } 57 58 public String getScheme() 59 { 60 return _scheme; 61 } 62 63 public void setScheme(String scheme) 64 { 65 _scheme = scheme; 66 } 67 68 public String getPath() 69 { 70 return _path; 71 } 72 73 public void setPath(String path) 74 { 75 _path = path; 76 } 77 78 public boolean exists() 79 { 80 return true; 81 } 82 83 public StreamImpl openReadImpl() throws IOException 84 { 85 return _stream; 86 } 87 88 public StreamImpl openWriteImpl() throws IOException 89 { 90 return _stream; 91 } 92 93 public StreamImpl openReadWriteImpl() throws IOException 94 { 95 return _stream; 96 } 97 98 public StreamImpl openAppendImpl() throws IOException 99 { 100 return _stream; 101 } 102 } 103 104 | Popular Tags |