public void uploadToFileNodes(String url, File[] localFiles, String[] fieldNames, String[] typeHints)
throws IOException {
List<Part> partsList = new ArrayList<Part>();
for (int i=0; i < localFiles.length; i++) {
Part filePart = new FilePart(fieldNames[i], localFiles[i]);
partsList.add(filePart);
if (typeHints != null) {
Part typeHintPart = new StringPart(fieldNames[i] + "@TypeHint", typeHints[i]);
partsList.add(typeHintPart);
}
}
final Part[] parts = partsList.toArray(new Part[partsList.size()]);