Example usage for org.apache.poi.hpsf HPSFPropertiesOnlyDocument getSummaryInformation

List of usage examples for org.apache.poi.hpsf HPSFPropertiesOnlyDocument getSummaryInformation

Introduction

In this page you can find the example usage for org.apache.poi.hpsf HPSFPropertiesOnlyDocument getSummaryInformation.

Prototype

public SummaryInformation getSummaryInformation() 

Source Link

Document

Fetch the Summary Information of the document

Usage

From source file:com.liferay.sync.engine.util.MSOfficeFileUtil.java

License:Open Source License

public static Date getLastSavedDate(Path filePath) {
    NPOIFSFileSystem npoifsFileSystem = null;

    try {//  w  ww  .  ja v  a2 s  . c  om
        npoifsFileSystem = new NPOIFSFileSystem(filePath.toFile());

        HPSFPropertiesOnlyDocument hpsfPropertiesOnlyDocument = new HPSFPropertiesOnlyDocument(
                npoifsFileSystem);

        SummaryInformation summaryInformation = hpsfPropertiesOnlyDocument.getSummaryInformation();

        return summaryInformation.getLastSaveDateTime();
    } catch (Exception e) {
        return null;
    } finally {
        if (npoifsFileSystem != null) {
            try {
                npoifsFileSystem.close();
            } catch (Exception e) {
                return null;
            }
        }
    }
}