javax.servlet.http

Interface Part


  • public interface Part

    This class represents a part or form item that was received within a multipart/form-data POST request.

    Since:
    Servlet 3.0
    • Method Detail

      • getInputStream

        InputStream getInputStream()
                            throws IOException
        Gets the content of this part as an InputStream
        Returns:
        The content of this part as an InputStream
        Throws:
        IOException - If an error occurs in retrieving the contet as an InputStream
      • getContentType

        String getContentType()
        Gets the content type of this part.
        Returns:
        The content type of this part.
      • getName

        String getName()
        Gets the name of this part
        Returns:
        The name of this part as a String
      • getSubmittedFileName

        String getSubmittedFileName()
        Gets the file name specified by the client
        Returns:
        the submitted file name
        Since:
        Servlet 3.1
      • getSize

        long getSize()
        Returns the size of this fille.
        Returns:
        a long specifying the size of this part, in bytes.
      • write

        void write(String fileName)
            throws IOException
        A convenience method to write this uploaded item to disk.

        This method is not guaranteed to succeed if called more than once for the same part. This allows a particular implementation to use, for example, file renaming, where possible, rather than copying all of the underlying data, thus gaining a significant performance benefit.

        Parameters:
        fileName - the name of the file to which the stream will be written. The file is created relative to the location as specified in the MultipartConfig
        Throws:
        IOException - if an error occurs.
      • delete

        void delete()
             throws IOException
        Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
        Throws:
        IOException - if an error occurs.
      • getHeader

        String getHeader(String name)
        Returns the value of the specified mime header as a String. If the Part did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. You can use this method with any request header.
        Parameters:
        name - a String specifying the header name
        Returns:
        a String containing the value of the requested header, or null if the part does not have a header of that name
      • getHeaders

        Collection<String> getHeaders(String name)
        Gets the values of the Part header with the given name.

        Any changes to the returned Collection must not affect this Part.

        Part header names are case insensitive.

        Parameters:
        name - the header name whose values to return
        Returns:
        a (possibly empty) Collection of the values of the header with the given name
      • getHeaderNames

        Collection<String> getHeaderNames()
        Gets the header names of this Part.

        Some servlet containers do not allow servlets to access headers using this method, in which case this method returns null

        Any changes to the returned Collection must not affect this Part.

        Returns:
        a (possibly empty) Collection of the header names of this Part

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/servlet/http/part.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.