1 29 30 package com.caucho.vfs; 31 32 import java.util.HashMap ; 33 34 50 public class SchemeMap { 51 public static final SchemeMap NULL_SCHEME_MAP = new SchemeMap(); 53 54 private final HashMap <String ,Path> _schemeMap 55 = new HashMap <String ,Path>(); 56 57 60 public SchemeMap() 61 { 62 } 63 64 67 private SchemeMap(HashMap <String ,Path> map) 68 { 69 _schemeMap.putAll(map); 70 } 71 72 77 static SchemeMap getNullSchemeMap() 78 { 79 return NULL_SCHEME_MAP; 80 } 81 82 85 public Path get(String scheme) 86 { 87 Path path = _schemeMap.get(scheme); 88 89 if (path != null) 90 return path; 91 else { 92 93 return new NotFoundPath(scheme + ":"); 94 } 95 } 96 97 100 public Path put(String scheme, Path path) 101 { 102 return _schemeMap.put(scheme, path); 103 } 104 105 public SchemeMap copy() 106 { 107 return new SchemeMap(_schemeMap); 108 } 109 110 113 public Path remove(String scheme) 114 { 115 return _schemeMap.remove(scheme); 116 } 117 } 118 | Popular Tags |