Class MediaExtractor


  • public class MediaExtractor
    extends java.lang.Object
    Extracts information about the media.
    • Constructor Summary

      Constructors 
      Constructor Description
      MediaExtractor​(org.zkoss.util.media.Media uploadedMedia)
      Creates instance of MediaExtractor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Returns the content type of the media.
      java.io.InputStream getDataAsStream()
      Extracts and returns the information as a InputStream using the default UTF-8 Charset.
      java.io.InputStream getDataAsStream​(java.nio.charset.Charset encoding)
      Extracts and returns the information as a InputStream.
      java.lang.String getDataAsString()
      Extracts and returns the information as a string.
      long getDataSize()
      Returns the information about the size of the media file.
      java.lang.String getName()
      Returns the media name.
      java.lang.String getTargetName()
      Returns the name of a file that will be created to store the uploaded file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MediaExtractor

        public MediaExtractor​(org.zkoss.util.media.Media uploadedMedia)
        Creates instance of MediaExtractor
        Parameters:
        uploadedMedia - media of which the information should be extracted
    • Method Detail

      • getDataAsString

        public java.lang.String getDataAsString()
        Extracts and returns the information as a string.
        Returns:
        information about the media
      • getDataAsStream

        public java.io.InputStream getDataAsStream​(java.nio.charset.Charset encoding)
        Extracts and returns the information as a InputStream.
        Parameters:
        encoding - the encoding that should be used when extracting data
        Returns:
        input stream containing information about the media
      • getDataAsStream

        public java.io.InputStream getDataAsStream()
        Extracts and returns the information as a InputStream using the default UTF-8 Charset.
        Returns:
        input stream containing information about the media
      • getDataSize

        public long getDataSize()
        Returns the information about the size of the media file.
        Returns:
        media file size
      • getName

        public java.lang.String getName()
        Returns the media name.
        Returns:
        media name
      • getTargetName

        public java.lang.String getTargetName()
        Returns the name of a file that will be created to store the uploaded file.
        Returns:
        uploaded file name
      • getContentType

        public java.lang.String getContentType()
        Returns the content type of the media.
        Returns:
        media content type