Example usage for io.netty.handler.codec.string LineSeparator UNIX

List of usage examples for io.netty.handler.codec.string LineSeparator UNIX

Introduction

In this page you can find the example usage for io.netty.handler.codec.string LineSeparator UNIX.

Prototype

LineSeparator UNIX

To view the source code for io.netty.handler.codec.string LineSeparator UNIX.

Click Source Link

Document

The Unix line separator(LF)

Usage

From source file:diskCacheV111.doors.NettyLineBasedDoor.java

License:Open Source License

public NettyLineBasedDoor(String cellName, Args args, NettyLineBasedInterpreterFactory factory,
        ExecutorService executor, PoolManagerHandler poolManagerHandler,
        IdentityResolverFactory idResolverFactory,
        LoadingCache<GetSpaceTokensKey, long[]> spaceDescriptionCache,
        LoadingCache<String, Optional<Space>> spaceLookupCache) {
    super(cellName, args, executor);

    this.factory = factory;
    this.executor = executor;
    this.commandExecutor = new SequentialExecutor(executor);
    this.poolManager = poolManagerHandler;

    this.charset = Charset.forName(args.getOption("charset", "UTF-8"));
    String lineSeparator = args.getOption("lineSeparator", "WINDOWS");
    switch (lineSeparator) {
    case "WINDOWS":
        this.lineSeparator = LineSeparator.WINDOWS;
        break;/*from w  w  w.  j a v  a2  s . c  o m*/
    case "UNIX":
        this.lineSeparator = LineSeparator.UNIX;
        break;
    default:
        throw new IllegalArgumentException("Invalid line separator value: " + lineSeparator);
    }

    this.expectProxyProtocol = args.getBooleanOption("expectProxyProtocol");
    this.idResolverFactory = idResolverFactory;
    this.spaceDescriptionCache = spaceDescriptionCache;
    this.spaceLookupCache = spaceLookupCache;
}