1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package javax.faces.application;
20
21 import java.io.IOException;
22 import java.io.InputStream;
23 import java.net.URL;
24 import java.util.Map;
25
26 import javax.faces.context.FacesContext;
27
28
29
30
31 public abstract class Resource extends ViewResource
32 {
33
34
35
36
37 public static final String COMPONENT_RESOURCE_KEY = "javax.faces.application.Resource.ComponentResource";
38
39 private String _contentType;
40 private String _libraryName;
41 private String _resourceName;
42
43 public String getContentType()
44 {
45 return _contentType;
46 }
47
48 public abstract InputStream getInputStream() throws IOException;
49
50 public String getLibraryName()
51 {
52 return _libraryName;
53 }
54
55 public abstract String getRequestPath();
56
57 public String getResourceName()
58 {
59 return _resourceName;
60 }
61
62 public abstract Map<String, String> getResponseHeaders();
63
64 public abstract URL getURL();
65
66 public void setContentType(String contentType)
67 {
68 _contentType = contentType;
69 }
70
71 public void setLibraryName(String libraryName)
72 {
73 _libraryName = libraryName;
74 }
75
76 public void setResourceName(String resourceName)
77 {
78 if (resourceName == null)
79 {
80 throw new NullPointerException();
81 }
82 _resourceName = resourceName;
83 }
84
85 @Override
86 public String toString()
87 {
88 return getRequestPath();
89 }
90
91 public abstract boolean userAgentNeedsUpdate(FacesContext context);
92 }