Class ExternalResource

  • All Implemented Interfaces:
    Resource, java.io.Serializable

    public class ExternalResource
    extends java.lang.Object
    implements Resource
    ExternalResource implements source for resources fetched from location specified by URL:s. The resources are fetched directly by the client terminal and are not fetched through the terminal adapter.
    Since:
    3.0
    Author:
    Vaadin Ltd.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ExternalResource​(java.lang.String sourceURL)
      Creates a new download component for downloading directly from given URL.
      ExternalResource​(java.lang.String sourceURL, java.lang.String mimeType)
      Creates a new download component for downloading directly from given URL.
      ExternalResource​(java.net.URL sourceURL)
      Creates a new download component for downloading directly from given URL.
      ExternalResource​(java.net.URL sourceURL, java.lang.String mimeType)
      Creates a new download component for downloading directly from given URL.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMIMEType()
      Gets the MIME type of the resource.
      java.lang.String getURL()
      Gets the URL of the external resource.
      void setMIMEType​(java.lang.String mimeType)
      Sets the MIME type of the resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExternalResource

        public ExternalResource​(java.net.URL sourceURL)
        Creates a new download component for downloading directly from given URL.
        Parameters:
        sourceURL - the source URL.
      • ExternalResource

        public ExternalResource​(java.net.URL sourceURL,
                                java.lang.String mimeType)
        Creates a new download component for downloading directly from given URL.
        Parameters:
        sourceURL - the source URL.
        mimeType - the MIME Type
      • ExternalResource

        public ExternalResource​(java.lang.String sourceURL)
        Creates a new download component for downloading directly from given URL.
        Parameters:
        sourceURL - the source URL.
      • ExternalResource

        public ExternalResource​(java.lang.String sourceURL,
                                java.lang.String mimeType)
        Creates a new download component for downloading directly from given URL.
        Parameters:
        sourceURL - the source URL.
        mimeType - the MIME Type
    • Method Detail

      • getURL

        public java.lang.String getURL()
        Gets the URL of the external resource.
        Returns:
        the URL of the external resource.
      • getMIMEType

        public java.lang.String getMIMEType()
        Gets the MIME type of the resource.
        Specified by:
        getMIMEType in interface Resource
        Returns:
        the MIME type of the resource.
        See Also:
        Resource.getMIMEType()
      • setMIMEType

        public void setMIMEType​(java.lang.String mimeType)
        Sets the MIME type of the resource.