try {
// set referrer
filePost.setRequestHeader("referer", "about:blank");
List<Part> partList = new ArrayList<Part>();
partList.add(new StringPart("action", "install"));
partList.add(new StringPart("_noredir_", "_noredir_"));
partList.add(new FilePart("bundlefile", new FilePartSource(
file.getName(), file)));
partList.add(new StringPart("bundlestartlevel", bundleStartLevel));
if (bundleStart) {
partList.add(new StringPart("bundlestart", "start"));
}
if (refreshPackages) {
partList.add(new StringPart("refreshPackages", "true"));
}
Part[] parts = partList.toArray(new Part[partList.size()]);
filePost.setRequestEntity(new MultipartRequestEntity(parts,