javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp
branchRCL_3
changeset 17 0fd27995241b
parent 14 04becd199f91
equal deleted inserted replaced
15:f9bb0fca356a 17:0fd27995241b
   131     for (tok = wcstok(stringToTokenize,delim,&last); tok!=NULL;
   131     for (tok = wcstok(stringToTokenize,delim,&last); tok!=NULL;
   132             tok = wcstok(NULL, delim, &last))
   132             tok = wcstok(NULL, delim, &last))
   133     {
   133     {
   134         path += std::wstring(tok);
   134         path += std::wstring(tok);
   135         path += L"\\";
   135         path += L"\\";
   136         char *dirName = JavaCommonUtils::wstringToUtf8(path);
   136         char *dirName =0;
       
   137         try 
       
   138         {
       
   139            dirName = JavaCommonUtils::wstringToUtf8(path);
       
   140         }
       
   141         catch (ExceptionBase ex)
       
   142         {
       
   143            delete[] stringToTokenize;
       
   144            return -1;
       
   145         }
   137         if (ableToOpen)
   146         if (ableToOpen)
   138         {
   147         {
   139             if (0 != lstat(dirName, &temp))
   148             if (0 != lstat(dirName, &temp))
   140             {
   149             {
   141                 ableToOpen = false;
   150                 ableToOpen = false;
   167 int ServerConnectionBase::removeDir(const std::wstring aDirPath)
   176 int ServerConnectionBase::removeDir(const std::wstring aDirPath)
   168 {
   177 {
   169     JELOG2(EWMA);
   178     JELOG2(EWMA);
   170     std::wstring path1;
   179     std::wstring path1;
   171     path1 +=  aDirPath;
   180     path1 +=  aDirPath;
       
   181     char* path =0;
   172     int error = 0;
   182     int error = 0;
   173     try
   183     try
   174     {
   184     {
   175         char* path = JavaCommonUtils::wstringToUtf8(path1);
   185         path = JavaCommonUtils::wstringToUtf8(path1);
   176         LOG1(EWMA, EInfo, "WMA : Removing Message Store %s",path);
   186         LOG1(EWMA, EInfo, "WMA : Removing Message Store %s",path);
   177         struct stat temp;
   187         struct stat temp;
   178         if (0 != lstat(path, &temp))
   188         if (0 != lstat(path, &temp))
   179         {
   189         {
   180             ELOG1(EWMA, "WMA : Directory doesn't Exists : %s", path);
   190             ELOG1(EWMA, "WMA : Directory doesn't Exists : %s", path);
   209         }
   219         }
   210         delete[] path;
   220         delete[] path;
   211     }
   221     }
   212     catch (ExceptionBase ex)
   222     catch (ExceptionBase ex)
   213     {
   223     {
       
   224         delete[] path;
   214         ELOG(EWMA,"WMA : Cought an exception while removing Dir");
   225         ELOG(EWMA,"WMA : Cought an exception while removing Dir");
       
   226         return -1;
   215     }
   227     }
   216     return error;
   228     return error;
   217 }
   229 }
   218 
   230 
   219 }// end of namespace wma
   231 }// end of namespace wma