Example usage for org.apache.commons.vfs2 FileContentInfoFactory create

List of usage examples for org.apache.commons.vfs2 FileContentInfoFactory create

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileContentInfoFactory create.

Prototype

FileContentInfo create(FileContent fileContent) throws FileSystemException;

Source Link

Document

Creates a FileContentInfo for a the given FileContent.

Usage

From source file:org.mycore.common.content.MCRVFSContent.java

@Override
public String getMimeType() throws IOException {
    if (super.getMimeType() != null) {
        return super.getMimeType();
    }//from   w w  w  .j  av a2 s .c o  m
    FileContentInfoFactory fileContentInfoFactory = fo.getFileSystem().getFileSystemManager()
            .getFileContentInfoFactory();
    FileContent content = fo.getContent();
    try {
        return fileContentInfoFactory.create(content).getContentType();
    } finally {
        content.close();
    }
}