1 16 package org.apache.log4j.lf5.util; 17 18 import java.io.InputStream ; 19 import java.io.InputStreamReader ; 20 import java.net.URL ; 21 22 28 29 31 public class Resource { 32 36 protected String _name; 40 41 45 49 52 public Resource() { 53 super(); 54 } 55 56 61 public Resource(String name) { 62 _name = name; 63 } 64 65 69 82 public void setName(String name) { 83 _name = name; 84 } 85 86 92 public String getName() { 93 return (_name); 94 } 95 96 103 public InputStream getInputStream() { 104 InputStream in = ResourceUtils.getResourceAsStream(this, this); 105 106 return (in); 107 } 108 109 116 public InputStreamReader getInputStreamReader() { 117 InputStream in = ResourceUtils.getResourceAsStream(this, this); 118 119 if (in == null) { 120 return null; 121 } 122 123 InputStreamReader reader = new InputStreamReader (in); 124 125 return reader; 126 } 127 128 133 public URL getURL() { 134 return (ResourceUtils.getResourceAsURL(this, this)); 135 } 136 137 141 145 149 } 150 151 152 153 154 155 156 | Popular Tags |