+ Try {
+ if (APP2EXT_SD_CARD !=
+ app2ext_get_app_location(m_context.tzPkgid.c_str()))
+ {
+ LogDebug("Removing directory");
+ m_context.removeStarted = true;
+ if (!WrtUtilRemove(m_context.installedPath)) {
+ LogError("Removing widget installation directory failed : " <<
+ m_context.installedPath);
+ }
+ std::string dataDir = m_context.locations->getUserDataRootDir();
+ if (!WrtUtilRemove(dataDir)) {
+ LogWarning(dataDir + " is already removed");
+ }
+ } else {
+ LogDebug("Removing sdcard directory");
+ Try {
+ WidgetInstallToExtSingleton::Instance().initialize(m_context.tzPkgid);
+ WidgetInstallToExtSingleton::Instance().uninstallation();
+ WidgetInstallToExtSingleton::Instance().deinitialize();
+ }
+ Catch(WidgetInstallToExt::Exception::ErrorInstallToExt)
+ {
+ Throw(Jobs::WidgetUninstall::TaskRemoveFiles::Exception::
+ RemoveFilesFailed);
+ }
+ }
+ } Catch(Exception::RemoveFilesFailed) {
+ ThrowMsg(Exceptions::RemoveFileFailure, "Cann't remove directory");