File file = new File(localFilePath);
String sBaseFileName = file.getName();
long lastModified = file.lastModified();
CXmlStructureFile inputFile = new CXmlStructureFile();
String sMD5 = DigestUtils.getMd5FileDigestString(localFilePath);
inputFile.setMD5(sMD5);
inputFile.setModifiedTime(lastModified);
inputFile.setPath(sBaseFileName);
inputFile.setSchemaType(0);
inputFile.setZippedBase64Contents(sEncodedContents);
CXmlStructureFile parentFile = null;
if (parentPath != null && parentPath.length() > 0) {
parentFile = new CXmlStructureFile();
parentFile.setPath(parentPath);
}
CXmlStructureFileUploadResult uploadResult = xmlInfo.uploadStructureFile(getConfiguration().getUserName(),
getConfiguration().getPassword(), inputFile, parentFile);
// This releases the file contents
sEncodedContents = null;
inputFile = null;
CXmlStructureFile resultFile = uploadResult.getXmlStructureFile();
ServerFile structureFile = ServerFile.fromPathAndHash(resultFile.getPath(), sMD5);
List<ServerFile> existingDependencies = Lists.newArrayList();
if (uploadResult.getExistingDependencies() != null) {
for (CXmlStructureFile dep : uploadResult.getExistingDependencies()) {
existingDependencies.add(ServerFile.fromPathAndHash(dep.getPath(), dep.getMD5()));