public abstract class

AbstractFileResolvingResource

extends AbstractResource
java.lang.Object
   ↳ org.springframework.core.io.AbstractResource
     ↳ org.springframework.core.io.AbstractFileResolvingResource
Known Direct Subclasses

Class Overview

Abstract base class for resources which resolve URLs into File references, such as UrlResource or ClassPathResource.

Detects the "file" protocol as well as the JBoss "vfs" protocol in URLs, resolving file system references accordingly.

Summary

Public Constructors
AbstractFileResolvingResource()
Public Methods
long contentLength()
This implementation checks the timestamp of the underlying File, if available.
boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
File getFile()
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
boolean isReadable()
This implementation always returns true.
long lastModified()
This implementation checks the timestamp of the underlying File, if available.
Protected Methods
File getFile(URI uri)
This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.
File getFileForLastModifiedCheck()
This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
[Expand]
Inherited Methods
From class org.springframework.core.io.AbstractResource
From class java.lang.Object
From interface org.springframework.core.io.InputStreamSource
From interface org.springframework.core.io.Resource

Public Constructors

public AbstractFileResolvingResource ()

Also: SpringCore

Public Methods

public long contentLength ()

Also: SpringCore

This implementation checks the timestamp of the underlying File, if available.

Throws
IOException

public boolean exists ()

Also: SpringCore

This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened. This will cover both directories and content resources.

public File getFile ()

Also: SpringCore

This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.

Throws
IOException

public boolean isReadable ()

Also: SpringCore

This implementation always returns true.

public long lastModified ()

Also: SpringCore

This implementation checks the timestamp of the underlying File, if available.

Throws
IOException

Protected Methods

protected File getFile (URI uri)

Also: SpringCore

This implementation returns a File reference for the underlying class path resource, provided that it refers to a file in the file system.

Throws
IOException

protected File getFileForLastModifiedCheck ()

Also: SpringCore

This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).

Returns
  • the File to use for timestamp checking (never null)
Throws
IOException