Example usage for org.apache.commons.vfs2 Capability COMPRESS

List of usage examples for org.apache.commons.vfs2 Capability COMPRESS

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 Capability COMPRESS.

Prototype

Capability COMPRESS

To view the source code for org.apache.commons.vfs2 Capability COMPRESS.

Click Source Link

Document

A compressed filesystem is a filesystem which use compression.

Usage

From source file:org.apache.commons.vfs2.example.Shell.java

private void info(String[] cmd) throws Exception {
    if (cmd.length > 1) {
        info(cmd[1]);/*from   w w w.  ja v a 2s .  c o  m*/
    } else {
        System.out.println("Default manager: \"" + mgr.getClass().getName() + "\" " + "version "
                + getVersion(mgr.getClass()));
        String[] schemes = mgr.getSchemes();
        List<String> virtual = new ArrayList<String>();
        List<String> physical = new ArrayList<String>();
        for (int i = 0; i < schemes.length; i++) {
            Collection<Capability> caps = mgr.getProviderCapabilities(schemes[i]);
            if (caps != null) {
                if (caps.contains(Capability.VIRTUAL) || caps.contains(Capability.COMPRESS)
                        || caps.contains(Capability.DISPATCHER)) {
                    virtual.add(schemes[i]);
                } else {
                    physical.add(schemes[i]);
                }
            }
        }
        if (!physical.isEmpty()) {
            System.out.println("  Provider Schemes: " + physical);
        }
        if (!virtual.isEmpty()) {
            System.out.println("   Virtual Schemes: " + virtual);
        }
    }
}

From source file:tain.kr.test.vfs.v01.Shell.java

private void info(String[] cmd) throws Exception {

    if (cmd.length > 1) {
        info(cmd[1]);/*from   w w w. j a v a 2s.com*/
    } else {
        System.out.println("Default manager: \"" + mgr.getClass().getName() + "\" " + "version "
                + getVersion(mgr.getClass()));

        String[] schemes = mgr.getSchemes();
        List<String> virtual = new ArrayList<String>();
        List<String> physical = new ArrayList<String>();

        for (int i = 0; i < schemes.length; i++) {
            Collection<Capability> caps = mgr.getProviderCapabilities(schemes[i]);
            if (caps != null) {
                if (caps.contains(Capability.VIRTUAL) || caps.contains(Capability.COMPRESS)
                        || caps.contains(Capability.DISPATCHER)) {
                    virtual.add(schemes[i]);
                } else {
                    physical.add(schemes[i]);
                }
            }
        }

        if (!physical.isEmpty()) {
            System.out.println("  Provider Schemes: " + physical);
        }

        if (!virtual.isEmpty()) {
            System.out.println("   Virtual Schemes: " + virtual);
        }
    }
}