Class MediaExtractor
- java.lang.Object
-
- de.hybris.platform.platformbackoffice.widgets.impex.MediaExtractor
-
public class MediaExtractor extends java.lang.ObjectExtracts information about the media.
-
-
Constructor Summary
Constructors Constructor Description MediaExtractor(org.zkoss.util.media.Media uploadedMedia)Creates instance ofMediaExtractor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()Returns the content type of the media.java.io.InputStreamgetDataAsStream()Extracts and returns the information as aInputStreamusing the default UTF-8 Charset.java.io.InputStreamgetDataAsStream(java.nio.charset.Charset encoding)Extracts and returns the information as aInputStream.java.lang.StringgetDataAsString()Extracts and returns the information as a string.longgetDataSize()Returns the information about the size of the media file.java.lang.StringgetName()Returns the media name.java.lang.StringgetTargetName()Returns the name of a file that will be created to store the uploaded file.
-
-
-
Constructor Detail
-
MediaExtractor
public MediaExtractor(org.zkoss.util.media.Media uploadedMedia)
Creates instance ofMediaExtractor- 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 aInputStream.- 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 aInputStreamusing 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
-
-