org.springframework.core.io
Class UrlResource

public class UrlResource
extends AbstractResource
Resource implementation for java.net.URL locators. Obviously supports resolution as URL, and also as File in case of the "file:" protocol.
Since28.12.2003
VersionNot specified.
AuthorJuergen Hoeller
See also
Wiki javadoc Use textile entry format.
Add your comments here.
Constructor Summary
UrlResource( URL url )
Create a new UrlResource.
UrlResource( String path )
Create a new UrlResource.
Method Summary
Resource createRelative( String relativePath )
This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.
boolean equals( Object obj )
This implementation compares the underlying URL references.
String getDescription()
This implementation returns a description that includes the URL.
File getFile()
This implementation returns a File reference for the underlying URL, provided that it refers to a file in the file system.
String getFilename()
This implementation returns the name of the file that this URL refers to.
InputStream getInputStream()
This implementation opens an InputStream for the given URL.
URL getURL()
This implementation returns the underlying URL reference.
int hashCode()
This implementation returns the hash code of the underlying URL reference.
Methods inherited from org.springframework.core.ioAbstractResource
Methods inherited from org.springframework.core.ioResource
UrlResource
public UrlResource ( URL url )
Create a new UrlResource.
Parameters
TypeNameDescription
URL url a URL
Wiki javadoc Use textile entry format.
Add your comments here.
UrlResource
public UrlResource ( String path )
Create a new UrlResource.
Parameters
TypeNameDescription
String path a URL path
Exceptions
MalformedURLException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
createRelative
public Resource createRelative ( String relativePath )
This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.
Overrides method in AbstractResource
Parameters
TypeNameDescription
String relativePath No description provided.
Exceptions
MalformedURLException No description provided.
See also
Wiki javadoc Use textile entry format.
Add your comments here.
equals
public boolean equals ( Object obj )
This implementation compares the underlying URL references.
Overrides method in AbstractResource
Parameters
TypeNameDescription
Object obj No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getDescription
public String getDescription ( )
This implementation returns a description that includes the URL.
Overrides method in AbstractResource
Wiki javadoc Use textile entry format.
Add your comments here.
getFile
public File getFile ( )
throws
This implementation returns a File reference for the underlying URL, provided that it refers to a file in the file system.
Overrides method in AbstractResource
Exceptions
IOException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getFilename
public String getFilename ( )
This implementation returns the name of the file that this URL refers to.
Overrides method in AbstractResource
Wiki javadoc Use textile entry format.
Add your comments here.
getInputStream
public InputStream getInputStream ( )
throws
This implementation opens an InputStream for the given URL. It sets the "UseCaches" flag to false, mainly to avoid jar file locking on Windows.
Implements method in InputStreamSource
Exceptions
IOException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
getURL
public URL getURL ( )
throws
This implementation returns the underlying URL reference.
Overrides method in AbstractResource
Exceptions
IOException No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
hashCode
public int hashCode ( )
This implementation returns the hash code of the underlying URL reference.
Overrides method in AbstractResource
Wiki javadoc Use textile entry format.
Add your comments here.