if (file == null) {
throw new IllegalArgumentException("No valid file 'null'!");
}
// Deploy need to be multipart
// file content must be posted as multipart/form-data
FileDataBodyPart filePart = new FileDataBodyPart("id", file);
FormDataMultiPart formpart = new FormDataMultiPart();
if (application != null) {
formpart = formpart.field("name", application);
}
if (contextroot != null) {