Class HttpResource

  • All Implemented Interfaces:
    org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource, org.springframework.web.servlet.resource.HttpResource

    public class HttpResource
    extends Object
    implements org.springframework.web.servlet.resource.HttpResource
    • Method Detail

      • expires

        public long expires()
      • isExpired

        public boolean isExpired()
      • exists

        public boolean exists()
        Specified by:
        exists in interface org.springframework.core.io.Resource
      • isReadable

        public boolean isReadable()
        Specified by:
        isReadable in interface org.springframework.core.io.Resource
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface org.springframework.core.io.Resource
      • getURL

        public URL getURL()
                   throws IOException
        Specified by:
        getURL in interface org.springframework.core.io.Resource
        Throws:
        IOException
      • getURI

        public URI getURI()
        Specified by:
        getURI in interface org.springframework.core.io.Resource
      • getFile

        public File getFile()
                     throws IOException
        Specified by:
        getFile in interface org.springframework.core.io.Resource
        Throws:
        IOException
      • contentLength

        public long contentLength()
                           throws IOException
        Specified by:
        contentLength in interface org.springframework.core.io.Resource
        Throws:
        IOException
      • contentType

        public org.springframework.util.MimeType contentType()
      • lastModified

        public long lastModified()
                          throws IOException
        Specified by:
        lastModified in interface org.springframework.core.io.Resource
        Throws:
        IOException
      • getFilename

        public String getFilename()
        Specified by:
        getFilename in interface org.springframework.core.io.Resource
      • getDescription

        public String getDescription()
        Specified by:
        getDescription in interface org.springframework.core.io.Resource
      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        Specified by:
        getInputStream in interface org.springframework.core.io.InputStreamSource
        Throws:
        IOException
      • isModified

        public boolean isModified()
      • fetched

        public boolean fetched()
        Checks, if the remote resource was already fetched.
        Returns:
        true, if the resource was already fetched, otherwise false
      • fetch

        public boolean fetch()
        Fetches the remote resource and reports, if it was modified.

        This method fetches the remote resource, if was not already fetched. If the resource was already fetched, it revalidates it, if necessary.

        Returns:
        true, if the resource has changed or was fetched for the first time, otherwise false
      • getResponseHeaders

        public org.springframework.http.HttpHeaders getResponseHeaders()
        Specified by:
        getResponseHeaders in interface org.springframework.web.servlet.resource.HttpResource
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object