public void save(SaveCallback saveCallback,
ProgressCallback progressCallback) throws ParseException {
if(!isDirty() || data == null) return;
ParseUploadCommand command = new ParseUploadCommand(getEndPoint());
command.setProgressCallback(progressCallback);
command.setData(data);
if(getContentType() == null) {
String fileExtension = MimeType.getFileExtension(getName());
contentType = MimeType.getMimeType(fileExtension);
command.setContentType(contentType);
}
else {
command.setContentType(getContentType());
}
ParseResponse response = command.perform();
if(!response.isFailed()) {
JSONObject jsonResponse = response.getJsonObject();
System.out.println(jsonResponse);
if (jsonResponse == null) {
LOGGER.error("Empty response.");