From: bri Date: Mon, 10 Feb 2014 14:08:03 +0000 (+0400) Subject: original file names are kept X-Git-Tag: Delivery_V1_0_2013_07_12~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=83e9c71298b24099fd6956ddd6eb588a093cb3a3;p=tools%2Fsimanio.git original file names are kept --- diff --git a/src/SimanIO_Link.cxx b/src/SimanIO_Link.cxx index dc5dfc0..2cc9779 100644 --- a/src/SimanIO_Link.cxx +++ b/src/SimanIO_Link.cxx @@ -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);