summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-11-05 06:43:30 +0000
committerAndreas Bille <abi@openoffice.org>2001-11-05 06:43:30 +0000
commit50f14b99c3a15a0c56c8250d5c0e775ebd862a6e (patch)
treec18fab1b9f7c8f2279ba5aa4f62adbf3f238029e /ucb
parentaf78d4d6c4bb682944658248eb2ef475caf1cd27 (diff)
#93535#,#91858#
New exception for ReplaceExisting=false in case of exsting directory( against logic, but works ). Content now have a valid identifier in every case.
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/file/bc.cxx15
-rw-r--r--ucb/source/ucp/file/filerror.hxx1
-rw-r--r--ucb/source/ucp/file/filglob.cxx7
-rw-r--r--ucb/source/ucp/file/shell.cxx12
-rw-r--r--ucb/source/ucp/file/shell.hxx7
5 files changed, 29 insertions, 13 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index 7245eb266f35..81b07c0c0cb6 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bc.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: hr $ $Date: 2001-10-24 16:20:07 $
+ * last change: $Author: abi $ $Date: 2001-11-05 07:43:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1250,12 +1250,13 @@ void SAL_CALL BaseContent::insert( sal_Int32 nMyCommandIdentifier,
aInsertArgument.Data );
else
success = m_pMyShell->mkdir( nMyCommandIdentifier,
- m_aUncPath );
+ m_aUncPath,
+ aInsertArgument.ReplaceExisting );
- if( ! success )
- {
- return;
- }
+// if( ! success )
+// {
+// return;
+// }
FileContentIdentifier* p = new FileContentIdentifier( m_pMyShell,m_aUncPath );
m_xContentIdentifier = Reference< XContentIdentifier >( p );
diff --git a/ucb/source/ucp/file/filerror.hxx b/ucb/source/ucp/file/filerror.hxx
index 137ee2f269f5..35266c6a3c71 100644
--- a/ucb/source/ucp/file/filerror.hxx
+++ b/ucb/source/ucp/file/filerror.hxx
@@ -44,6 +44,7 @@ namespace fileaccess {
#define TASKHANDLING_NOREPLACE_FOR_WRITE 34
#define TASKHANDLING_ENSUREDIR_FOR_WRITE 35
+#define TASKHANDLING_FOLDER_EXISTS_MKDIR 69
#define TASKHANDLING_CREATEDIRECTORY_MKDIR 36
#define TASKHANDLING_NOSUCHFILEORDIR_FOR_REMOVE 38
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index 7570e4d76170..6aec1be2368d 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -566,6 +566,13 @@ namespace fileaccess {
aAny <<= NameClashException();
cancelCommandExecution( aAny,xEnv );
}
+ else if( errorCode == TASKHANDLING_FOLDER_EXISTS_MKDIR )
+ {
+ ioErrorCode = IOErrorCode_ALREADY_EXISTING;
+ cancelCommandExecution( ioErrorCode,
+ generateErrorArguments(pShell,aUncPath),
+ xEnv );
+ }
else if( errorCode == TASKHANDLING_ENSUREDIR_FOR_WRITE ||
errorCode == TASKHANDLING_CREATEDIRECTORY_MKDIR )
{
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index c1be9046e25a..08ba988c80e2 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shell.cxx,v $
*
- * $Revision: 1.56 $
+ * $Revision: 1.57 $
*
- * last change: $Author: hr $ $Date: 2001-10-24 17:02:49 $
+ * last change: $Author: abi $ $Date: 2001-11-05 07:43:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1565,7 +1565,8 @@ shell::remove( sal_Int32 CommandId,
sal_Bool SAL_CALL
shell::mkdir( sal_Int32 CommandId,
- const rtl::OUString& rUnqPath )
+ const rtl::OUString& rUnqPath,
+ sal_Bool OverWrite )
throw()
{
rtl::OUString aUnqPath;
@@ -1581,7 +1582,12 @@ shell::mkdir( sal_Int32 CommandId,
switch ( nError )
{
case osl::FileBase::E_EXIST: // Directory cannot be overwritten
+ {
+ if( ! OverWrite )
+ installError( CommandId,
+ TASKHANDLING_FOLDER_EXISTS_MKDIR );
return sal_False;
+ }
case osl::FileBase::E_None:
{
rtl::OUString aPrtPath = getParentName( aUnqPath );
diff --git a/ucb/source/ucp/file/shell.hxx b/ucb/source/ucp/file/shell.hxx
index c5810976f31b..63ce8d541fe3 100644
--- a/ucb/source/ucp/file/shell.hxx
+++ b/ucb/source/ucp/file/shell.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shell.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mhu $ $Date: 2001-08-15 16:43:31 $
+ * last change: $Author: abi $ $Date: 2001-11-05 07:43:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -460,7 +460,8 @@ namespace fileaccess {
sal_Bool SAL_CALL
mkdir( sal_Int32 CommandId,
- const rtl::OUString& aDirectoryName )
+ const rtl::OUString& aDirectoryName,
+ sal_Bool OverWrite )
throw();