Example usage for org.apache.commons.vfs Capability LIST_CHILDREN

List of usage examples for org.apache.commons.vfs Capability LIST_CHILDREN

Introduction

In this page you can find the example usage for org.apache.commons.vfs Capability LIST_CHILDREN.

Prototype

Capability LIST_CHILDREN

To view the source code for org.apache.commons.vfs Capability LIST_CHILDREN.

Click Source Link

Document

Children of files can be listed.

Usage

From source file:org.objectweb.proactive.extensions.dataspaces.vfs.VFSNodeScratchSpaceImpl.java

private void checkCapabilities(FileSystem fs) throws ConfigurationException {
    // let's have at least those capabilities that scratch space does
    // final Capability[] expected = PADataSpaces.getCapabilitiesForSpaceType(SpaceType.SCRATCH);

    // but you never know what is there.. therefore:
    final Capability[] expected = new Capability[] { Capability.CREATE, Capability.DELETE, Capability.GET_TYPE,
            Capability.LIST_CHILDREN, Capability.READ_CONTENT, Capability.WRITE_CONTENT };

    for (int i = 0; i < expected.length; i++) {
        final Capability capability = expected[i];

        if (fs.hasCapability(capability))
            continue;

        logger.error("Scratch file system does not support capability: " + capability);
        throw new ConfigurationException("Scratch file system does not support capability: " + capability);
    }/*from w w w.j a  v  a 2  s .  c om*/
}