2626 */
2727public interface WebResource {
2828 /**
29+ * Returns the last modified time.
30+ *
2931 * @return {@link java.io.File#lastModified()}.
3032 */
3133 long getLastModified ();
3234
3335 /**
36+ * Returns the last modified time in HTTP format.
37+ *
3438 * @return the last modified time of this resource in the correct format for the HTTP Last-Modified header as
3539 * specified by RFC 2616.
3640 */
3741 String getLastModifiedHttp ();
3842
3943 /**
44+ * Checks if this resource exists.
45+ *
4046 * @return {@link java.io.File#exists()}.
4147 */
4248 boolean exists ();
@@ -51,48 +57,64 @@ public interface WebResource {
5157 boolean isVirtual ();
5258
5359 /**
60+ * Checks if this resource is a directory.
61+ *
5462 * @return {@link java.io.File#isDirectory()}.
5563 */
5664 boolean isDirectory ();
5765
5866 /**
67+ * Checks if this resource is a file.
68+ *
5969 * @return {@link java.io.File#isFile()}.
6070 */
6171 boolean isFile ();
6272
6373 /**
74+ * Deletes this resource.
75+ *
6476 * @return {@link java.io.File#delete()}.
6577 */
6678 boolean delete ();
6779
6880 /**
81+ * Returns the name of this resource.
82+ *
6983 * @return {@link java.io.File#getName()}.
7084 */
7185 String getName ();
7286
7387 /**
88+ * Returns the content length of this resource.
89+ *
7490 * @return {@link java.io.File#length()}.
7591 */
7692 long getContentLength ();
7793
7894 /**
95+ * Returns the canonical path of this resource.
96+ *
7997 * @return {@link java.io.File#getCanonicalPath()}.
8098 */
8199 String getCanonicalPath ();
82100
83101 /**
102+ * Checks if this resource can be read.
103+ *
84104 * @return {@link java.io.File#canRead()}.
85105 */
86106 boolean canRead ();
87107
88108 /**
109+ * Returns the webapp path of this resource.
110+ *
89111 * @return The path of this resource relative to the web application root. If the resource is a directory, the
90112 * return value will end in '/'.
91113 */
92114 String getWebappPath ();
93115
94116 /**
95- * Return the weak ETag calculated from the content length and last modified.
117+ * Returns the weak ETag calculated from the content length and last modified.
96118 *
97119 * @return The ETag for this resource
98120 */
@@ -116,31 +138,39 @@ default String getStrongETag() {
116138 void setMimeType (String mimeType );
117139
118140 /**
141+ * Returns the MIME type for this Resource.
142+ *
119143 * @return the MIME type for this Resource.
120144 */
121145 String getMimeType ();
122146
123147 /**
124- * Obtain an InputStream based on the contents of this resource.
148+ * Obtains an InputStream based on the contents of this resource.
125149 *
126150 * @return An InputStream based on the contents of this resource or <code>null</code> if the resource does not exist
127151 * or does not represent a file
128152 */
129153 InputStream getInputStream ();
130154
131155 /**
156+ * Returns the binary content of this resource.
157+ *
132158 * @return the binary content of this resource or {@code null} if it is not available in a byte[] because, for
133159 * example, it is too big.
134160 */
135161 byte [] getContent ();
136162
137163 /**
164+ * Returns the creation time of this resource.
165+ *
138166 * @return The time the file was created. If not available, the result of {@link #getLastModified()} will be
139167 * returned.
140168 */
141169 long getCreation ();
142170
143171 /**
172+ * Returns a URL to access this resource.
173+ *
144174 * @return a URL to access the resource or <code>null</code> if no such URL is available or if the resource does not
145175 * exist.
146176 */
@@ -160,18 +190,24 @@ default URL getCodeBase() {
160190 }
161191
162192 /**
193+ * Returns a reference to the WebResourceRoot of which this WebResource is a part.
194+ *
163195 * @return a reference to the WebResourceRoot of which this WebResource is a part.
164196 */
165197 WebResourceRoot getWebResourceRoot ();
166198
167199 /**
200+ * Returns the certificates that were used to sign this resource to verify it.
201+ *
168202 * @return the certificates that were used to sign this resource to verify it or @null if none.
169203 *
170204 * @see java.util.jar.JarEntry#getCertificates()
171205 */
172206 Certificate [] getCertificates ();
173207
174208 /**
209+ * Returns the manifest associated with this resource.
210+ *
175211 * @return the manifest associated with this resource or @null if none.
176212 *
177213 * @see java.util.jar.JarFile#getManifest()
0 commit comments