int responseCode = HTTP_RESPONSE_FAIL;
final String versionText = loginData.getOption(SERVER_VERSION);
final int version = ParserUtil.parseInt(versionText, SERVER_VERSION_SUGAR);
if (SERVER_VERSION_SUGAR == version) {
PublishRestUtil publishRestUtil = new PublishRestUtil(loginData.getUrl(), loginData.getUsername(), loginData.getPassword());
responseCode = publishRestUtil.publishFile(path, data, true);
} else {
final FileObject connection = createVFSConnection(loginData);
final FileObject object = connection.resolveFile(path);
final OutputStream out = object.getContent().getOutputStream(false);