Skip to content

Commit

Permalink
Update Resource interface in the reference manual
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Feb 15, 2021
1 parent ff43731 commit 7225238
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions src/docs/asciidoc/core/core-resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ such as a method to check for the existence of the resource being pointed to.
[[resources-resource]]
== The Resource Interface

Spring's `Resource` interface is meant to be a more capable interface for abstracting
access to low-level resources. The following listing shows the `Resource` interface
definition:
Spring's `Resource` interface located in the `org.springframework.core.io.` package is
meant to be a more capable interface for abstracting access to low-level resources. The
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"]
.Java
Expand All @@ -44,17 +46,30 @@ definition:
boolean exists();
boolean isReadable();
boolean isOpen();
boolean isFile();
URL getURL() throws IOException;
URI getURI() throws IOException;
File getFile() throws IOException;
ReadableByteChannel readableChannel() throws IOException;
long contentLength() throws IOException;
long lastModified() throws IOException;
Resource createRelative(String relativePath) throws IOException;
String getFilename();
String getDescription();
}
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
Expand All @@ -64,12 +79,28 @@ definition:
fun exists(): Boolean
val isOpen: Boolean
fun isReadable(): Boolean
fun isOpen(): Boolean
val url: URL
fun isFile(): Boolean
fun getURL(): URL
@Throws(IOException::class)
fun getURI(): URI
val file: File
@Throws(IOException::class)
fun readableChannel(): ReadableByteChannel
@Throws(IOException::class)
fun contentLength(): long
@Throws(IOException::class)
fun lastModified(): long
@Throws(IOException::class)
fun createRelative(relativePath: String): Resource
Expand Down

0 comments on commit 7225238

Please sign in to comment.