Code example for BasicHttpEntity

Methods: setContentsetContentLength

0
            } 
        } else if (resource != null) {
            if (file != null || value != null) {
                throw new BuildException("Only one of 'file' or 'value' attribute or nested resource is supported"); 
            } 
            BasicHttpEntity basicEntity = new BasicHttpEntity();
            try { 
                basicEntity.setContent(resource.getInputStream());
            } catch (IOException e) {
                throw new BuildException("I/O error while getting a stream out of the resource " + resource, e);
            } 
            basicEntity.setContentLength(resource.getSize());
            entity = basicEntity;
        } else { 
            throw new BuildException("At least one of 'file' or 'value' attribute or nested resource is required"); 
        } 
        if (contentType != null) {
            entity.setContentType(contentType);
        } 
        if (contentEncoding != null) {
Connect your IDE to all the code out there  Get Codota for Java