public String restoreSnapshot(IProgressMonitor monitor) throws IOException {
   if (monitor.isCanceled()) {
     return null;
   }
   storeSnapshotToPreferences(filepath, deploymentSnapshot);
   Session session = SSHSessionRepository.getInstance().getSession(application);
   FileInputStream snapshotFileInputStream = new FileInputStream(new File(getFilepath()));
   InputStream saveResponse = null;
   if (isDeploymentSnapshot()) {
     saveResponse =
         new ApplicationSSHSession(application, session)
             .restoreDeploymentSnapshot(snapshotFileInputStream, hotDeploy);
   } else {
     saveResponse =
         new ApplicationSSHSession(application, session)
             .restoreFullSnapshot(snapshotFileInputStream);
   }
   ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
   StreamUtils.writeTo(saveResponse, byteArrayOut);
   return new String(byteArrayOut.toByteArray());
 }