use of io.scal.secureshare.controller.SiteController in project storymaker by StoryMaker.
the class SSHUploader method start.
// FIXME move the render file checks into base class
@Override
public void start() {
// TODO Auto-generated constructor stub
final SiteController controller = SiteController.getSiteController(SSHSiteController.SITE_KEY, mContext, mHandler, "" + mJob.getId());
final Project project = mJob.getProject();
final PublishJob publishJob = mJob.getPublishJob();
final String path = publishJob.getLastRenderFilePath();
final Auth auth = (new AuthTable()).getAuthDefault(mContext, SSHSiteController.SITE_KEY);
if (Utils.stringNotBlank(path) && (new File(path)).exists()) {
// FIXME move to strings.xml
jobProgress(mJob, 0, "Uploading to SSH server...");
HashMap<String, String> valueMap = publishJob.getMetadata();
addValuesToHashmap(valueMap, project.getTitle(), project.getDescription(), path);
controller.upload(auth.convertToAccountObject(), valueMap);
} else {
Timber.d("Can't upload to SSH, last rendered file doesn't exist.");
// TODO get this error back to the activity for display
// FIXME move to strings.xml
jobFailed(null, ERROR_NO_RENDER_FILE, "Can't upload to SSH server, last rendered file doesn't exist.");
}
}
Aggregations