public class

VfsResource

extends AbstractResource
java.lang.Object
   ↳ org.springframework.core.io.AbstractResource
     ↳ org.springframework.core.io.VfsResource

Class Overview

VFS based Resource implementation. Supports the corresponding VFS API versions on JBoss AS 5.x as well as 6.x.

See Also
  • org.jboss.virtual.VirtualFile
  • org.jboss.vfs.VirtualFile

Summary

Public Constructors
VfsResource(Object resources)
Public Methods
Resource createRelative(String relativePath)
This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.
boolean equals(Object obj)
This implementation compares description strings.
boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
String getDescription()
File getFile()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.
String getFilename()
This implementation always throws IllegalStateException, assuming that the resource does not have a filename.
InputStream getInputStream()
URI getURI()
This implementation builds a URI based on the URL returned by getURL().
URL getURL()
This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.
int hashCode()
This implementation returns the description's hash code.
boolean isReadable()
This implementation always returns true.
long lastModified()
This implementation checks the timestamp of the underlying File, if available.
[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 VfsResource (Object resources)

Also: SpringCore

Public Methods

public Resource createRelative (String relativePath)

Also: SpringCore

This implementation throws a FileNotFoundException, assuming that relative resources cannot be created for this resource.

Parameters
relativePath the relative path (relative to this resource)
Returns
  • the resource handle for the relative resource
Throws
IOException

public boolean equals (Object obj)

This implementation compares description strings.

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 String getDescription ()

Also: SpringCore

public File getFile ()

Also: SpringCore

This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to an absolute file path.

Throws
IOException

public String getFilename ()

Also: SpringCore

This implementation always throws IllegalStateException, assuming that the resource does not have a filename.

public InputStream getInputStream ()

Also: SpringCore

Throws
IOException

public URI getURI ()

Also: SpringCore

This implementation builds a URI based on the URL returned by getURL().

Throws
IOException

public URL getURL ()

Also: SpringCore

This implementation throws a FileNotFoundException, assuming that the resource cannot be resolved to a URL.

Throws
IOException

public int hashCode ()

This implementation returns the description's hash code.

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