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

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

Introduction

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

Prototype

long usableSpace();

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 av  a2 s  . c  o m
        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()));
            }
        }
    });
}