Update Resource interface in the reference manual
See gh-26447
This commit is contained in:
parent
ff43731347
commit
7225238ad5
|
|
@ -33,9 +33,11 @@ such as a method to check for the existence of the resource being pointed to.
|
||||||
[[resources-resource]]
|
[[resources-resource]]
|
||||||
== The Resource Interface
|
== The Resource Interface
|
||||||
|
|
||||||
Spring's `Resource` interface is meant to be a more capable interface for abstracting
|
Spring's `Resource` interface located in the `org.springframework.core.io.` package is
|
||||||
access to low-level resources. The following listing shows the `Resource` interface
|
meant to be a more capable interface for abstracting access to low-level resources. The
|
||||||
definition:
|
following listing provides an overview of the `Resource` interface. See the
|
||||||
|
{api-spring-framework}/core/io/Resource.html[`Resource`] javadoc for further details.
|
||||||
|
|
||||||
|
|
||||||
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
|
||||||
.Java
|
.Java
|
||||||
|
|
@ -44,17 +46,30 @@ definition:
|
||||||
|
|
||||||
boolean exists();
|
boolean exists();
|
||||||
|
|
||||||
|
boolean isReadable();
|
||||||
|
|
||||||
boolean isOpen();
|
boolean isOpen();
|
||||||
|
|
||||||
|
boolean isFile();
|
||||||
|
|
||||||
URL getURL() throws IOException;
|
URL getURL() throws IOException;
|
||||||
|
|
||||||
|
URI getURI() throws IOException;
|
||||||
|
|
||||||
File getFile() throws IOException;
|
File getFile() throws IOException;
|
||||||
|
|
||||||
|
ReadableByteChannel readableChannel() throws IOException;
|
||||||
|
|
||||||
|
long contentLength() throws IOException;
|
||||||
|
|
||||||
|
long lastModified() throws IOException;
|
||||||
|
|
||||||
Resource createRelative(String relativePath) throws IOException;
|
Resource createRelative(String relativePath) throws IOException;
|
||||||
|
|
||||||
String getFilename();
|
String getFilename();
|
||||||
|
|
||||||
String getDescription();
|
String getDescription();
|
||||||
|
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
|
||||||
|
|
@ -64,12 +79,28 @@ definition:
|
||||||
|
|
||||||
fun exists(): Boolean
|
fun exists(): Boolean
|
||||||
|
|
||||||
val isOpen: Boolean
|
fun isReadable(): Boolean
|
||||||
|
|
||||||
val url: URL
|
fun isOpen(): Boolean
|
||||||
|
|
||||||
|
fun isFile(): Boolean
|
||||||
|
|
||||||
|
fun getURL(): URL
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
fun getURI(): URI
|
||||||
|
|
||||||
val file: File
|
val file: File
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
fun readableChannel(): ReadableByteChannel
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
fun contentLength(): long
|
||||||
|
|
||||||
|
@Throws(IOException::class)
|
||||||
|
fun lastModified(): long
|
||||||
|
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun createRelative(relativePath: String): Resource
|
fun createRelative(relativePath: String): Resource
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue