Example usage for io.vertx.core.file FileSystemProps totalSpace

List of usage examples for io.vertx.core.file FileSystemProps totalSpace

Introduction

In this page you can find the example usage for io.vertx.core.file FileSystemProps totalSpace.

Prototype

long totalSpace();

Source Link

Usage

From source file:org.entcore.common.storage.impl.FileStorage.java

License:Open Source License

@Override
public void stats(final Handler<AsyncResult<BucketStats>> handler) {
    fs.fsProps(basePath, new Handler<AsyncResult<FileSystemProps>>() {
        @Override/*from   w w w .  j a  va  2  s  . c  om*/
        public void handle(AsyncResult<FileSystemProps> event) {
            if (event.succeeded()) {
                final FileSystemProps fsProps = event.result();
                final BucketStats bucketStats = new BucketStats();
                bucketStats.setStorageSize(fsProps.totalSpace() - fsProps.usableSpace());
                handler.handle(new DefaultAsyncResult<>(bucketStats));
            } else {
                handler.handle(new DefaultAsyncResult<BucketStats>(event.cause()));
            }
        }
    });
}