Abstract WebResource implementation that provides common functionality for all web resource implementations.
| 31 | * Abstract {@link WebResource} implementation that provides common functionality for all web resource implementations. |
| 32 | */ |
| 33 | public abstract class AbstractResource implements WebResource { |
| 34 | |
| 35 | /** The string manager for this class. */ |
| 36 | protected static final StringManager sm = StringManager.getManager(AbstractResource.class); |
| 37 | |
| 38 | /** The root. */ |
| 39 | private final WebResourceRoot root; |
| 40 | /** The web app path. */ |
| 41 | private final String webAppPath; |
| 42 | |
| 43 | /** The MIME type. */ |
| 44 | private String mimeType = null; |
| 45 | /** The weak ETag. */ |
| 46 | private volatile String weakETag; |
| 47 | /** The strong ETag. */ |
| 48 | private volatile String strongETag; |
| 49 | |
| 50 | |
| 51 | /** |
| 52 | * Constructs a new AbstractResource. |
| 53 | * |
| 54 | * @param root The root |
| 55 | * @param webAppPath The web app path |
| 56 | */ |
| 57 | protected AbstractResource(WebResourceRoot root, String webAppPath) { |
| 58 | this.root = root; |
| 59 | this.webAppPath = webAppPath; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | /** |
| 64 | * Gets the web resource root. |
| 65 | * |
| 66 | * @return The web resource root |
| 67 | */ |
| 68 | @Override |
| 69 | public final WebResourceRoot getWebResourceRoot() { |
| 70 | return root; |
| 71 | } |
| 72 | |
| 73 | |
| 74 | /** |
| 75 | * Gets the web app path. |
| 76 | * |
| 77 | * @return The web app path |
| 78 | */ |
| 79 | @Override |
| 80 | public final String getWebappPath() { |
| 81 | return webAppPath; |
| 82 | } |
| 83 | |
| 84 | |
| 85 | /** |
| 86 | * Gets the last modified date as an HTTP date string. |
| 87 | * |
| 88 | * @return The last modified date as an HTTP date string |
| 89 | */ |
| 90 | @Override |
nothing calls this directly
no test coverage detected