javax.mail

Class URLName


  • public class URLName
    extends Object
    The name of a URL. This class represents a URL name and also provides the basic parsing functionality to parse most internet standard URL schemes.

    Note that this class differs from java.net.URL in that this class just represents the name of a URL, it does not model the connection to a URL.

    Author:
    Christopher Cotton, Bill Shannon
    • Field Detail

      • fullURL

        protected String fullURL
        The full version of the URL
    • Constructor Detail

      • URLName

        public URLName(String protocol,
                       String host,
                       int port,
                       String file,
                       String username,
                       String password)
        Creates a URLName object from the specified protocol, host, port number, file, username, and password. Specifying a port number of -1 indicates that the URL should use the default port for the protocol.
      • URLName

        public URLName(URL url)
        Construct a URLName from a java.net.URL object.
      • URLName

        public URLName(String url)
        Construct a URLName from the string. Parses out all the possible information (protocol, host, port, file, username, password).
    • Method Detail

      • toString

        public String toString()
        Constructs a string representation of this URLName.
        Overrides:
        toString in class Object
      • parseString

        protected void parseString(String url)
        Method which does all of the work of parsing the string.
      • getPort

        public int getPort()
        Returns the port number of this URLName. Returns -1 if the port is not set.
      • getProtocol

        public String getProtocol()
        Returns the protocol of this URLName. Returns null if this URLName has no protocol.
      • getFile

        public String getFile()
        Returns the file name of this URLName. Returns null if this URLName has no file name.
      • getRef

        public String getRef()
        Returns the reference of this URLName. Returns null if this URLName has no reference.
      • getHost

        public String getHost()
        Returns the host of this URLName. Returns null if this URLName has no host.
      • getUsername

        public String getUsername()
        Returns the user name of this URLName. Returns null if this URLName has no user name.
      • getPassword

        public String getPassword()
        Returns the password of this URLName. Returns null if this URLName has no password.
      • equals

        public boolean equals(Object obj)
        Compares two URLNames. The result is true if and only if the argument is not null and is a URLName object that represents the same URLName as this object. Two URLName objects are equal if they have the same protocol and the same host, the same port number on the host, the same username, and the same file on the host. The fields (host, username, file) are also considered the same if they are both null.

        Hosts are considered equal if the names are equal (case independent) or if host name lookups for them both succeed and they both reference the same IP address.

        Note that URLName has no knowledge of default port numbers for particular protocols, so "imap://host" and "imap://host:143" would not compare as equal.

        Note also that the password field is not included in the comparison, nor is any reference field appended to the filename.

        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Compute the hash code for this URLName.
        Overrides:
        hashCode in class Object

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/mail/urlname.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.