Example usage for org.apache.http.util Args notNull

List of usage examples for org.apache.http.util Args notNull

Introduction

In this page you can find the example usage for org.apache.http.util Args notNull.

Prototype

public static <T> T notNull(T t, String str) 

Source Link

Usage

From source file:com.messagemedia.restapi.client.v1.internal.RestRequestBuilder.java

private RestRequestBuilder(String endpoint, String path, HttpMethod method, RestClient client) {

    Args.notBlank(path, "path");
    Args.notNull(method, "method");
    Args.notNull(client, "client");
    Args.notBlank(endpoint, "endpoint");

    try {//from w  w  w.j a v a 2s .  c om
        this.uriBuilder = new URIBuilder(endpoint);
    } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e);
    }

    this.path = path;
    this.client = client;
    this.method = method;
    this.headers = new HashMap<String, String>();
}

From source file:onl.area51.httpd.util.PathEntity.java

@SuppressWarnings("OverridableMethodCallInConstructor")
public PathEntity(final Path file, final ContentType contentType) {
    super();/* w  ww  .j  ava2 s  .c  om*/
    this.file = Args.notNull(file, "Path");
    if (contentType != null) {
        setContentType(contentType.toString());
    }
}

From source file:com.ok2c.lightmtp.impl.protocol.ServiceReadyCodec.java

public ServiceReadyCodec(final SMTPBuffers iobuffers, final RemoteAddressValidator addressValidator) {
    super();// w  w  w . j  av a 2  s.co  m
    Args.notNull(iobuffers, "IO buffers");
    this.iobuffers = iobuffers;
    this.addressValidator = addressValidator;
    this.writer = new SMTPReplyWriter();
}

From source file:org.jenkinsci.plugins.relution_publisher.net.requests.BaseRequest.java

/**
 * Creates a new instance of the {@link BaseRequest} class.
 * @param method The request {@link Method} to be used for the request.
 * @param url The base URI that identifies the target of the request.
 * @param responseClass A class that identifies the type of entity that is expected to be
 * returned as a response of the request.
 *///from w  w w . ja  v a2s.c o m
protected BaseRequest(final Method method, final String uri) {
    Args.notNull(method, "method");
    Args.notNull(uri, "uri");

    this.mMethod = method;
    this.mUri = uri;
}

From source file:com.ok2c.lightmtp.impl.protocol.cmd.DefaultProtocolHandler.java

public void unregister(final String cmd) {
    Args.notNull(cmd, "Command name");
    this.map.remove(cmd.toUpperCase(Locale.US));
}

From source file:com.ok2c.lightmtp.impl.protocol.SendQuitCodec.java

public SendQuitCodec(final SMTPBuffers iobuffers) {
    super();//from w ww . ja  va2  s .  c o m
    Args.notNull(iobuffers, "IO buffers");
    this.iobuffers = iobuffers;
    this.parser = new SMTPReplyParser();
    this.writer = new SMTPCommandWriter();
    this.codecState = CodecState.QUIT_READY;
}

From source file:com.ok2c.lightmtp.impl.protocol.SendRsetCodec.java

public SendRsetCodec(final SMTPBuffers iobuffers) {
    super();// w  w w .  j  a  v a 2s.co  m
    Args.notNull(iobuffers, "IO buffers");
    this.iobuffers = iobuffers;
    this.parser = new SMTPReplyParser();
    this.writer = new SMTPCommandWriter();
    this.codecState = CodecState.RSET_READY;
}

From source file:com.ok2c.lightmtp.impl.protocol.SimpleSendHeloCodec.java

public SimpleSendHeloCodec(final SMTPBuffers iobuffers) {
    super();//w  w w . j  a  v  a  2 s. c  o  m
    Args.notNull(iobuffers, "IO buffers");
    this.iobuffers = iobuffers;
    this.parser = new SMTPReplyParser();
    this.writer = new SMTPCommandWriter();
    this.codecState = CodecState.SERVICE_READY_EXPECTED;
}

From source file:org.fao.geonet.utils.nio.PathHttpEntity.java

public PathHttpEntity(final Path file, final ContentType contentType) {
    super();//  w  w  w .  ja v  a 2 s. c om
    this.file = Args.notNull(file, "File");
    if (contentType != null) {
        setContentType(contentType.toString());
    }
}

From source file:com.ok2c.lightmtp.impl.protocol.cmd.DefaultProtocolHandler.java

@Override
public Action<ServerState> handle(final SMTPCommand command) throws SMTPErrorException {
    Args.notNull(command, "Command");
    String cmd = command.getVerb();
    CommandHandler<ServerState> handler = this.map.get(cmd.toUpperCase(Locale.US));
    if (handler != null) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("Command " + command);
        }//  w w w  .ja v  a  2s  . c  o m
        return handler.handle(command.getArgument(), command.getParams());
    } else {
        throw new SMTPErrorException(SMTPCodes.ERR_PERM_SYNTAX_ERR_COMMAND, new SMTPCode(5, 5, 1),
                "command not recognized");
    }
}