]> SALOME platform Git repositories - tools/simanio.git/commitdiff
Salome HOME
original file names are kept
authorbri <bri@opencascade.com>
Mon, 10 Feb 2014 14:08:03 +0000 (18:08 +0400)
committerbri <bri@opencascade.com>
Mon, 10 Feb 2014 14:08:03 +0000 (18:08 +0400)
src/SimanIO_Link.cxx

index dc5dfc0efb5ccec9bdad35f3dd12ffc9a3addda6..2cc9779c1e4c0dccf5f6139d99988069199b1827 100644 (file)
@@ -138,6 +138,8 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf()
       for(; aFileIter.More(); aFileIter.Next()) {
         string aURL = aFileIter.URL();
         string aFileName = aURL.substr(aURL.find_last_of("/\\")+1);
+        int startUnderlineIndex = aFileName.find_first_of("_") + 1;
+        string aSourceFileName = aFileName.substr(startUnderlineIndex, aFileName.find_last_of(".") - startUnderlineIndex);
         
         //cout << "aURL = " << "http://" << aSimanWSHost << "/repository/" << aURL << "\n";
         string aPathToVault = aResponseFilePath.substr(0, aResponseFilePath.find("download")) + "vault/";
@@ -153,7 +155,7 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf()
         aGetFileRequest->setArgs0(aPathToVault + aURL);
         aGetFileResponse = aStub->getFile(aGetFileRequest);
         
-        outputStream.open((aClientFileDir + aFileName).c_str(), ofstream::binary);
+        outputStream.open((aClientFileDir + aSourceFileName).c_str(), ofstream::binary);
         int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
         int* aBufSize = new int[aBufferSize];
         unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);