StString StProcess::getAbsolutePath(const StString& thePath) { StString aPath; if(thePath.isStartsWith(ST_FILE_PROTOCOL)) { const StString aData = thePath.subString(ST_FILE_PROTOCOL.getLength(), thePath.getLength()); aPath.fromUrl(aData); } else { aPath = thePath; } if(StFileNode::isAbsolutePath(aPath)) { return aPath; } return StProcess::getWorkingFolder() + aPath; // make absolute path }
void StAndroidGlue::setOpenPath(const jstring theOpenPath, const jstring theMimeType, const jboolean theIsLaunchedFromHistory) { JNIEnv* aJniEnv = myActivity->env; StString anOpenPath = stStringFromJava(aJniEnv, theOpenPath); StString aMimeType = stStringFromJava(aJniEnv, theMimeType); const StString ST_FILE_PROTOCOL("file://"); if(anOpenPath.isStartsWith(ST_FILE_PROTOCOL)) { const size_t aCutFrom = ST_FILE_PROTOCOL.getLength(); const StString aPath = anOpenPath.subString(aCutFrom, (size_t )-1); anOpenPath.fromUrl(aPath); } StMutexAuto aLock(myFetchLock); if(myCreatePath.isEmpty()) { myCreatePath = anOpenPath; } // ignore outdated intent from history list - use C++ recent list instead if(!theIsLaunchedFromHistory) { myDndPath = anOpenPath; } }