2 * Copyright 2007 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.wamblee.system.spring;
18 import org.springframework.core.io.Resource;
20 import java.io.ByteArrayInputStream;
22 import java.io.IOException;
23 import java.io.InputStream;
34 class StringResource implements Resource {
38 private String _value;
41 * Creates a new StringResource object.
43 * @param aValue DOCUMENT ME!
45 public StringResource(String aValue) {
52 * @param aRelativePath DOCUMENT ME!
54 * @return DOCUMENT ME!
56 * @throws IOException DOCUMENT ME!
59 public Resource createRelative(String aRelativePath)
61 throw new IOException("No relative resource possible");
67 * @return DOCUMENT ME!
70 public boolean exists() {
77 * @return DOCUMENT ME!
80 public String getDescription() {
81 return "Properties of a spring component";
87 * @return DOCUMENT ME!
89 * @throws IOException DOCUMENT ME!
92 public File getFile() throws IOException {
93 throw new IOException();
99 * @return DOCUMENT ME!
102 public String getFilename() {
103 return "springcomponent.properties";
109 * @return DOCUMENT ME!
111 * @throws IOException DOCUMENT ME!
114 public URL getURL() throws IOException {
115 throw new IOException();
121 * @return DOCUMENT ME!
124 public boolean isOpen() {
131 * @return DOCUMENT ME!
133 * @throws IOException DOCUMENT ME!
136 public InputStream getInputStream() throws IOException {
137 return new ByteArrayInputStream(_value.getBytes());