| 构造器和说明 |
|---|
AbstractResource() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
exists()
Determine whether this resource actually exists in physical form.
|
boolean |
isReadable()
Indicate whether non-empty contents of this resource can be read via
Resource.getInputStream(). |
ReadableByteChannel |
readableChannel()
Return a
ReadableByteChannel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontentLength, getInputStream, getRealResourcepublic boolean isReadable()
ResourceResource.getInputStream().
Will be true for typical resource descriptors that exist
since it strictly implies Resource.exists() semantics as of 5.1.
Note that actual content reading may still fail when attempted.
However, a value of false is a definitive indication
that the resource content cannot be read.
isReadable 在接口中 Resource<E>Resource.getInputStream(),
Resource.exists()public boolean exists()
ResourceThis method performs a definitive existence check, whereas the
existence of a Resource handle only guarantees a valid
descriptor handle.
public ReadableByteChannel readableChannel() throws IOException
ResourceReadableByteChannel.
It is expected that each call creates a fresh channel.
The default implementation returns Channels.newChannel(InputStream)
with the result of Resource.getInputStream().
readableChannel 在接口中 Resource<E>null)FileNotFoundException - if the underlying resource doesn't existIOException - if the content channel could not be openedResource.getInputStream()Copyright © 2020. All rights reserved.