Example usage for org.apache.commons.vfs2 FileContent getAttributes

List of usage examples for org.apache.commons.vfs2 FileContent getAttributes

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileContent getAttributes.

Prototype

Map<String, Object> getAttributes() throws FileSystemException;

Source Link

Document

Returns a read-only map of this file's attributes.

Usage

From source file:com.yenlo.synapse.transport.vfs.VFSUtils.java

/**
 * Get a String property from FileContent message
 *
 * @param message the File message//  w  w w  .j  a  va  2s .com
 * @param property property name
 * @return property value
 */
public static String getProperty(FileContent message, String property) {
    try {
        Object o = message.getAttributes().get(property);
        if (o instanceof String) {
            return (String) o;
        }
    } catch (FileSystemException ignored) {
    }
    return null;
}