Class ExternalResource

java.lang.Object
com.vaadin.featurepack.server.ExternalResource
All Implemented Interfaces:
Resource, Serializable

public class ExternalResource extends Object implements Resource, Serializable
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 trough the terminal adapter.
Since:
3.0
Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • ExternalResource

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

      public ExternalResource(URL sourceURL, 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(String sourceURL)
      Creates a new download component for downloading directly from given URL.
      Parameters:
      sourceURL - the source URL.
    • ExternalResource

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

    • getURL

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

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

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