public class

DescriptiveResource

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

Class Overview

Simple Resource implementation that holds a resource description but does not point to an actually readable resource.

To be used as placeholder if a Resource argument is expected by an API but not necessarily used for actual reading.

Summary

Public Constructors
DescriptiveResource(String description)
Create a new DescriptiveResource.
Public Methods
boolean equals(Object obj)
This implementation compares the underlying description String.
boolean exists()
This implementation checks whether a File can be opened, falling back to whether an InputStream can be opened.
String getDescription()
InputStream getInputStream()
int hashCode()
This implementation returns the hash code of the underlying description String.
boolean isReadable()
This implementation always returns true.
[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 DescriptiveResource (String description)

Also: SpringCore

Create a new DescriptiveResource.

Parameters
description the resource description

Public Methods

public boolean equals (Object obj)

This implementation compares the underlying description String.

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 InputStream getInputStream ()

Also: SpringCore

Throws
IOException

public int hashCode ()

This implementation returns the hash code of the underlying description String.

public boolean isReadable ()

Also: SpringCore

This implementation always returns true.