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

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

Introduction

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

Prototype

public HPSFPropertiesOnlyDocument(POIFSFileSystem fs) 

Source Link

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 {//from  www. j  a v a 2s  .c  o  m
        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;
            }
        }
    }
}