Code example for FileEntity

0
        AbstractHttpEntity entity;
        if (file != null) {
            if (value != null || resource != null) {
                throw new BuildException("Only one of 'file' or 'value' attribute or nested resource is supported"); 
            } 
            entity = new FileEntity(file);
        } else if (value != null) {
            if (file != null || resource != null) {
                throw new BuildException("Only one of 'file' or 'value' attribute or nested resource is supported"); 
            } 
            try { 
                entity = new StringEntity(value);
            } catch (UnsupportedEncodingException e) {
                throw new BuildException("Unsupported default encoding", e);
            } 
        } 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();
Contextual code suggestions in your IDE  Get Codota for Java