1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.resolver;
18
19 import java.io.ByteArrayInputStream;
20 import java.io.InputStream;
21 import java.net.URL;
22 import java.util.ArrayList;
23 import java.util.List;
24
25 import org.exoplatform.resolver.ResourceResolver;
26
27
28
29
30
31
32
33 public class StringResourceResolver extends ResourceResolver {
34
35 private String templateData ;
36
37 public StringResourceResolver(String templateData) {
38 this.templateData = templateData ;
39 }
40
41 public InputStream getInputStream(String template) throws Exception {
42 return new ByteArrayInputStream(templateData.getBytes());
43 }
44
45 public List<InputStream> getInputStreams(String template) throws Exception {
46 List<InputStream> list = new ArrayList<InputStream>();
47 list.add(getInputStream(template)) ;
48 return list;
49 }
50
51 @SuppressWarnings("unused")
52 public URL getResource(String arg0) throws Exception { return null; }
53
54 @SuppressWarnings("unused")
55 public String getResourceScheme() { return null; }
56
57 @SuppressWarnings("unused")
58 public List<URL> getResources(String arg0) throws Exception { return null; }
59
60 @SuppressWarnings("unused")
61 public boolean isModified(String arg0, long arg1) { return false; }
62
63 }