@@ -161,6 +161,7 @@ public final String getPath() {
161
161
/**
162
162
* This implementation returns whether the underlying file exists.
163
163
* @see java.io.File#exists()
164
+ * @see java.nio.file.Files#exists(Path, java.nio.file.LinkOption...)
164
165
*/
165
166
@ Override
166
167
public boolean exists () {
@@ -172,6 +173,8 @@ public boolean exists() {
172
173
* (and corresponds to an actual file with content, not to a directory).
173
174
* @see java.io.File#canRead()
174
175
* @see java.io.File#isDirectory()
176
+ * @see java.nio.file.Files#isReadable(Path)
177
+ * @see java.nio.file.Files#isDirectory(Path, java.nio.file.LinkOption...)
175
178
*/
176
179
@ Override
177
180
public boolean isReadable () {
@@ -180,8 +183,8 @@ public boolean isReadable() {
180
183
}
181
184
182
185
/**
183
- * This implementation opens a NIO file stream for the underlying file.
184
- * @see java.io.FileInputStream
186
+ * This implementation opens an NIO file stream for the underlying file.
187
+ * @see java.nio.file.Files#newInputStream(Path, java.nio.file.OpenOption...)
185
188
*/
186
189
@ Override
187
190
public InputStream getInputStream () throws IOException {
@@ -198,6 +201,8 @@ public InputStream getInputStream() throws IOException {
198
201
* (and corresponds to an actual file with content, not to a directory).
199
202
* @see java.io.File#canWrite()
200
203
* @see java.io.File#isDirectory()
204
+ * @see java.nio.file.Files#isWritable(Path)
205
+ * @see java.nio.file.Files#isDirectory(Path, java.nio.file.LinkOption...)
201
206
*/
202
207
@ Override
203
208
public boolean isWritable () {
@@ -207,7 +212,7 @@ public boolean isWritable() {
207
212
208
213
/**
209
214
* This implementation opens a FileOutputStream for the underlying file.
210
- * @see java.io.FileOutputStream
215
+ * @see java.nio.file.Files#newOutputStream(Path, java.nio.file.OpenOption...)
211
216
*/
212
217
@ Override
213
218
public OutputStream getOutputStream () throws IOException {
@@ -217,6 +222,7 @@ public OutputStream getOutputStream() throws IOException {
217
222
/**
218
223
* This implementation returns a URL for the underlying file.
219
224
* @see java.io.File#toURI()
225
+ * @see java.nio.file.Path#toUri()
220
226
*/
221
227
@ Override
222
228
public URL getURL () throws IOException {
@@ -226,6 +232,7 @@ public URL getURL() throws IOException {
226
232
/**
227
233
* This implementation returns a URI for the underlying file.
228
234
* @see java.io.File#toURI()
235
+ * @see java.nio.file.Path#toUri()
229
236
*/
230
237
@ Override
231
238
public URI getURI () throws IOException {
@@ -343,6 +350,7 @@ public Resource createRelative(String relativePath) {
343
350
/**
344
351
* This implementation returns the name of the file.
345
352
* @see java.io.File#getName()
353
+ * @see java.nio.file.Path#getFileName()
346
354
*/
347
355
@ Override
348
356
public String getFilename () {
@@ -353,6 +361,7 @@ public String getFilename() {
353
361
* This implementation returns a description that includes the absolute
354
362
* path of the file.
355
363
* @see java.io.File#getAbsolutePath()
364
+ * @see java.nio.file.Path#toAbsolutePath()
356
365
*/
357
366
@ Override
358
367
public String getDescription () {
@@ -361,16 +370,18 @@ public String getDescription() {
361
370
362
371
363
372
/**
364
- * This implementation compares the underlying File references.
373
+ * This implementation compares the underlying file paths.
374
+ * @see #getPath()
365
375
*/
366
376
@ Override
367
- public boolean equals (@ Nullable Object other ) {
368
- return (this == other || (other instanceof FileSystemResource &&
369
- this .path .equals ((( FileSystemResource ) other ) .path )));
377
+ public boolean equals (@ Nullable Object obj ) {
378
+ return (this == obj || (obj instanceof FileSystemResource other &&
379
+ this .path .equals (other .path )));
370
380
}
371
381
372
382
/**
373
- * This implementation returns the hash code of the underlying File reference.
383
+ * This implementation returns the hash code of the underlying file path.
384
+ * @see #getPath()
374
385
*/
375
386
@ Override
376
387
public int hashCode () {
0 commit comments