com.silverpeas.util
Class MetadataExtractor

java.lang.Object
  extended by com.silverpeas.util.MetadataExtractor

public class MetadataExtractor
extends Object


Method Summary
 String detectMimeType(File file)
          Detects the media type of the given file.
 MetaData extractMetadata(File file)
           
 MetaData extractMetadata(String fileName)
          Return Metadata of a document.
static MetadataExtractor getInstance()
          Gets the singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MetadataExtractor getInstance()
Gets the singleton instance.

Returns:

extractMetadata

public MetaData extractMetadata(String fileName)
Return Metadata of a document.

Parameters:
fileName -
Returns:
Metadata

extractMetadata

public MetaData extractMetadata(File file)

detectMimeType

public String detectMimeType(File file)
                      throws IOException
Detects the media type of the given file. The type detection is based on the document content and a potential known file extension.

Parameters:
file - the file
Returns:
detected media type
Throws:
IOException - if the file can not be read


Copyright © 2016 Silverpeas. All Rights Reserved.