summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-08-20 11:56:12 +0000
committerRüdiger Timm <rt@openoffice.org>2004-08-20 11:56:12 +0000
commit14da9ae278a3637e8924cb520538a548ced7a6ef (patch)
tree29518b776af6c75d0af7e2fc71a63f36de1bbcdd /configmgr
parent2b34e17de3ce984402dcaf8e356a0d3118ddda35 (diff)
INTEGRATION: CWS cfgruggedised (1.14.6); FILE MERGED
2004/07/23 13:29:40 jb 1.14.6.1: #i28654#,#i29838# Add InteractionHandler support to configuration
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/misc/filehelper.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/configmgr/source/misc/filehelper.cxx b/configmgr/source/misc/filehelper.cxx
index 568aef8320f0..75a471bb215a 100644
--- a/configmgr/source/misc/filehelper.cxx
+++ b/configmgr/source/misc/filehelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filehelper.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: obo $ $Date: 2004-07-05 13:24:48 $
+ * last change: $Author: rt $ $Date: 2004-08-20 12:56:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -116,6 +116,19 @@ namespace configmgr
}
// -----------------------------------------------------------------------------
+ bool FileHelper::tryToRemoveFile(const rtl::OUString& _aURL, bool tryBackupFirst)
+ {
+ if (tryBackupFirst)
+ {
+ rtl::OUString aBakURL = _aURL.concat( ASCII(".bak") );
+ File::RC eBakError = File::move(_aURL,aBakURL);
+ if (eBakError == File::E_None)
+ return true;
+ }
+ File::RC eError = File::remove(_aURL);
+ return eError == File::E_None || eError == File::E_NOENT;
+ }
+ // -----------------------------------------------------------------------------
void FileHelper::replaceFile(
const rtl::OUString& _aToURL, const rtl::OUString &_aFromURL) CFG_THROW1 (io::IOException)
{