Example usage for java.nio.file AccessMode READ

List of usage examples for java.nio.file AccessMode READ

Introduction

In this page you can find the example usage for java.nio.file AccessMode READ.

Prototype

AccessMode READ

To view the source code for java.nio.file AccessMode READ.

Click Source Link

Document

Test read access.

Usage

From source file:com.github.fge.ftpfs.io.commonsnetimpl.CommonsNetFtpAgent.java

private static EnumSet<AccessMode> calculateAccess(final FTPFile file) {
    final EnumSet<AccessMode> ret = EnumSet.noneOf(AccessMode.class);
    if (file.hasPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION))
        ret.add(AccessMode.READ);
    if (file.hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION))
        ret.add(AccessMode.WRITE);
    if (file.hasPermission(FTPFile.USER_ACCESS, FTPFile.EXECUTE_PERMISSION))
        ret.add(AccessMode.EXECUTE);
    return ret;/*from   w w w .  j  a  v  a2  s  .  c  o  m*/
}