Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
javax.activation

Class FileDataSource

  • All Implemented Interfaces:
    DataSource

    public class FileDataSource
    extends Object
    implements DataSource
    The FileDataSource class implements a simple DataSource object that encapsulates a file. It provides data typing services via a FileTypeMap object.

    FileDataSource Typing Semantics

    The FileDataSource class delegates data typing of files to an object subclassed from the FileTypeMap class. The setFileTypeMap method can be used to explicitly set the FileTypeMap for an instance of FileDataSource. If no FileTypeMap is set, the FileDataSource will call the FileTypeMap's getDefaultFileTypeMap method to get the System's default FileTypeMap.

    Since:
    1.6
    See Also:
    DataSource, FileTypeMap, MimetypesFileTypeMap
    • Constructor Detail

      • FileDataSource

        public FileDataSource(File file)
        Creates a FileDataSource from a File object. Note: The file will not actually be opened until a method is called that requires the file to be opened.
        Parameters:
        file - the file
      • FileDataSource

        public FileDataSource(String name)
        Creates a FileDataSource from the specified path name. Note: The file will not actually be opened until a method is called that requires the file to be opened.
        Parameters:
        name - the system-dependent file name.
    • Method Detail

      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        This method will return an InputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of InputStream with each invocation.
        Specified by:
        getInputStream in interface DataSource
        Returns:
        an InputStream
        Throws:
        IOException
      • getOutputStream

        public OutputStream getOutputStream()
                                     throws IOException
        This method will return an OutputStream representing the the data and will throw an IOException if it can not do so. This method will return a new instance of OutputStream with each invocation.
        Specified by:
        getOutputStream in interface DataSource
        Returns:
        an OutputStream
        Throws:
        IOException
      • getContentType

        public String getContentType()
        This method returns the MIME type of the data in the form of a string. This method uses the currently installed FileTypeMap. If there is no FileTypeMap explictly set, the FileDataSource will call the getDefaultFileTypeMap method on FileTypeMap to acquire a default FileTypeMap. Note: By default, the FileTypeMap used will be a MimetypesFileTypeMap.
        Specified by:
        getContentType in interface DataSource
        Returns:
        the MIME Type
        See Also:
        FileTypeMap.getDefaultFileTypeMap()
      • getName

        public String getName()
        Return the name of this object. The FileDataSource will return the file name of the object.
        Specified by:
        getName in interface DataSource
        Returns:
        the name of the object.
        See Also:
        DataSource
      • getFile

        public File getFile()
        Return the File object that corresponds to this FileDataSource.
        Returns:
        the File object for the file represented by this object.
      • setFileTypeMap

        public void setFileTypeMap(FileTypeMap map)
        Set the FileTypeMap to use with this FileDataSource
        Parameters:
        map - The FileTypeMap for this 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 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/activation/FileDataSource.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 Diese 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.

Inhaltsverzeichnis Haut