Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » core » io » [javadoc | source]
org.springframework.core.io
public class: UrlResource [javadoc | source]
java.lang.Object
   org.springframework.core.io.AbstractResource
      org.springframework.core.io.UrlResource

All Implemented Interfaces:
    Resource

Resource implementation for java.net.URL locators. Obviously supports resolution as URL, and also as File in case of the "file:" protocol.
Constructor:
 public UrlResource(URL url) 
    Create a new UrlResource.
    Parameters:
    url - a URL
 public UrlResource(URI uri) throws MalformedURLException 
    Create a new UrlResource.
    Parameters:
    uri - a URI
    Throws:
    MalformedURLException - if the given URL path is not valid
 public UrlResource(String path) throws MalformedURLException 
    Create a new UrlResource.
    Parameters:
    path - a URL path
    Throws:
    MalformedURLException - if the given URL path is not valid
Method from org.springframework.core.io.UrlResource Summary:
createRelative,   equals,   getDescription,   getFile,   getFileForLastModifiedCheck,   getFilename,   getInputStream,   getURI,   getURL,   hashCode
Methods from org.springframework.core.io.AbstractResource:
createRelative,   equals,   exists,   getFile,   getFileForLastModifiedCheck,   getFilename,   getURI,   getURL,   hashCode,   isOpen,   isReadable,   lastModified,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.core.io.UrlResource Detail:
 public Resource createRelative(String relativePath) throws MalformedURLException 
    This implementation creates a UrlResource, applying the given path relative to the path of the underlying URL of this resource descriptor.
 public boolean equals(Object obj) 
    This implementation compares the underlying URL references.
 public String getDescription() 
    This implementation returns a description that includes the URL.
 public File getFile() throws IOException 
    This implementation returns a File reference for the underlying URL/URI, provided that it refers to a file in the file system.
 protected File getFileForLastModifiedCheck() throws IOException 
    This implementation determines the underlying File (or jar file, in case of a resource in a jar/zip).
 public String getFilename() 
    This implementation returns the name of the file that this URL refers to.
 public InputStream getInputStream() throws IOException 
    This implementation opens an InputStream for the given URL. It sets the "UseCaches" flag to false, mainly to avoid jar file locking on Windows.
 public URI getURI() throws IOException 
    This implementation returns the underlying URI directly, if possible.
 public URL getURL() throws IOException 
    This implementation returns the underlying URL reference.
 public int hashCode() 
    This implementation returns the hash code of the underlying URL reference.