javax.activation

Class URLDataSource

  • All Implemented Interfaces:
    DataSource

    public class URLDataSource
    extends Object
    implements DataSource
    The URLDataSource class provides an object that wraps a URL object in a DataSource interface. URLDataSource simplifies the handling of data described by URLs within the JavaBeans Activation Framework because this class can be used to create new DataHandlers. NOTE: The DataHandler object creates a URLDataSource internally, when it is constructed with a URL.
    Since:
    1.6
    See Also:
    DataSource, DataHandler
    • Constructor Detail

      • URLDataSource

        public URLDataSource(URL url)
        URLDataSource constructor. The URLDataSource class will not open a connection to the URL until a method requiring it to do so is called.
        Parameters:
        url - The URL to be encapsulated in this object.
    • Method Detail

      • getContentType

        public String getContentType()
        Returns the value of the URL content-type header field. It calls the URL's URLConnection.getContentType method after retrieving a URLConnection object. Note: this method attempts to call the openConnection method on the URL. If this method fails, or if a content type is not returned from the URLConnection, getContentType returns "application/octet-stream" as the content type.
        Specified by:
        getContentType in interface DataSource
        Returns:
        the content type.
      • getName

        public String getName()
        Calls the getFile method on the URL used to instantiate the object.
        Specified by:
        getName in interface DataSource
        Returns:
        the result of calling the URL's getFile method.
      • getOutputStream

        public OutputStream getOutputStream()
                                     throws IOException
        The getOutputStream method from the URL. First an attempt is made to get the URLConnection object for the URL. If that succeeds, the getOutputStream method on the URLConnection is returned.
        Specified by:
        getOutputStream in interface DataSource
        Returns:
        the OutputStream.
        Throws:
        IOException
      • getURL

        public URL getURL()
        Return the URL used to create this DataSource.
        Returns:
        The URL.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 11/06/2005, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/activation/URLDataSource.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut