summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/file/filglob.cxx
blob: 7537007499dbb0ca03a102b1cf793f8b3ffd9344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
#ifndef _FILGLOB_HXX_
#include "filglob.hxx"
#endif
#ifndef _FILERROR_HXX_
#include "filerror.hxx"
#endif
#ifndef _SHELL_HXX_
#include "shell.hxx"
#endif
#ifndef _OSL_FILE_HXX_
#include <osl/file.hxx>
#endif
#ifndef INCLUDED_STL_VECTOR
#include <vector>
#define INCLUDED_STL_VECTOR
#endif
#ifndef _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
#include <ucbhelper/cancelcommandexecution.hxx>
#endif
#ifndef _COM_SUN_STAR_UCB_COMMANDABORTEDEXCEPTION_HPP_
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#endif
#ifndef  _COM_SUN_STAR_UCB_UNSUPPORTEDCOMMANDEXCEPTION_HPP_
#include <com/sun/star/ucb/UnsupportedCommandException.hpp>
#endif
#ifndef  _COM_SUN_STAR_UCB_UNSUPPORTEDOPENMODEEXCEPTION_HPP_
#include <com/sun/star/ucb/UnsupportedOpenModeException.hpp>
#endif
#ifndef  _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_IOERRORCODE_HPP_
#include <com/sun/star/ucb/IOErrorCode.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_MISSINGPROPERTIESEXCEPTION_HPP_
#include <com/sun/star/ucb/MissingPropertiesException.hpp>
#endif
#ifndef  _COM_SUN_STAR_UCB_MISSINGINPUTSTREAMEXCEPTION_HPP_
#include <com/sun/star/ucb/MissingInputStreamException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_NAMECLASHEXCEPTION_HPP_
#include <com/sun/star/ucb/NameClashException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFERURLEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveBadTransferURLException.hpp>
#endif
#ifndef _COM_SUN_STAR_UCB_UNSUPPORTEDNAMECLASHEXCEPTION_HPP_
#include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
#include "com/sun/star/breans/PropertyState.hpp"
#endif
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
#include "com/sun/star/breans/PropertyValue.hpp"
#endif
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
#include "com/sun/star/uno/Any.hxx"
#endif
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
#include "com/sun/star/uno/Sequence.hxx"
#endif
#ifndef _OSL_DIAGNOSE_H_
#include "osl/diagnose.h"
#endif
#ifndef _RTL_USTRING_H_
#include "rtl/ustring.h"
#endif
#ifndef _RTL_USTRING_HXX_
#include "rtl/ustring.hxx"
#endif
#ifndef _SAL_TYPES_H_
#include "sal/types.h"
#endif

using namespace ucbhelper;
using namespace osl;
using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;

namespace {

Sequence< Any > generateErrorArguments(fileaccess::shell * pShell,
                                       rtl::OUString const & rPhysicalUrl)
{
    OSL_ENSURE(pShell, "specification violation");

    rtl::OUString aUri;
    rtl::OUString aResourceName;
    rtl::OUString aResourceType;
    bool bUri = false;
    bool bResourceName = false;
    bool bResourceType = false;

    if (pShell->uncheckMountPoint(rPhysicalUrl, aUri))
    {
        bUri = true;
        // For security reasons, exhibit the system path only if it is not
        // subject to mount point mapping:
        if (rPhysicalUrl == aUri
            && osl::FileBase::getSystemPathFromFileURL(rPhysicalUrl,
                                                       aResourceName)
                   == osl::FileBase::E_None)
            bResourceName = true;
    }

    // The resource types "folder" (i.e., directory) and "volume" seem to be
    // the most interesting when producing meaningful error messages:
    osl::DirectoryItem aItem;
    if (osl::DirectoryItem::get(rPhysicalUrl, aItem) == osl::FileBase::E_None)
    {
        osl::FileStatus aStatus(FileStatusMask_Type);
        if (aItem.getFileStatus(aStatus) == osl::FileBase::E_None)
            switch (aStatus.getFileType())
            {
            case osl::FileStatus::Directory:
                aResourceType
                    = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("folder"));
                bResourceType = true;
                break;

            case osl::FileStatus::Volume:
                aResourceType
                    = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("volume"));
                bResourceType = true;
                break;
            }
    }

    Sequence< Any > aArguments((bUri ? 1 : 0)
                                   + (bResourceName ? 1 : 0)
                                   + (bResourceType ? 1 : 0));
    sal_Int32 i = 0;
    if (bUri)
        aArguments[i++]
            <<= PropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
                                                "Uri")),
                              -1,
                              makeAny(aUri),
                              PropertyState_DIRECT_VALUE);
    if (bResourceName)
        aArguments[i++]
            <<= PropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
                                                "ResourceName")),
                              -1,
                              makeAny(aResourceName),
                              PropertyState_DIRECT_VALUE);
    if (bResourceType)
        aArguments[i++]
            <<= PropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
                                                "ResourceType")),
                              -1,
                              makeAny(aResourceType),
                              PropertyState_DIRECT_VALUE);
    return aArguments;
}

}

namespace fileaccess {


    sal_Bool isChild( const rtl::OUString& srcUnqPath,
                      const rtl::OUString& dstUnqPath )
    {
        static sal_Unicode slash = '/';
        // Simple lexical comparison
        sal_Int32 srcL = srcUnqPath.getLength();
        sal_Int32 dstL = dstUnqPath.getLength();

        return (
            ( srcUnqPath == dstUnqPath )
            ||
            ( ( dstL > srcL )
              &&
              ( srcUnqPath.compareTo( dstUnqPath, srcL ) == 0 )
              &&
              ( dstUnqPath[ srcL ] == slash ) )
        );
    }


    rtl::OUString newName(
        const rtl::OUString& aNewPrefix,
        const rtl::OUString& aOldPrefix,
        const rtl::OUString& old_Name )
    {
        sal_Int32 srcL = aOldPrefix.getLength();

        rtl::OUString new_Name = old_Name.copy( srcL );
        new_Name = ( aNewPrefix + new_Name );
        return new_Name;
    }


    rtl::OUString getTitle( const rtl::OUString& aPath )
    {
        sal_Unicode slash = '/';
        sal_Int32 lastIndex = aPath.lastIndexOf( slash );
        return aPath.copy( lastIndex + 1 );
    }


    rtl::OUString getParentName( const rtl::OUString& aFileName )
    {
        sal_Int32 lastIndex = aFileName.lastIndexOf( sal_Unicode('/') );
        rtl::OUString aParent = aFileName.copy( 0,lastIndex );

        if( aParent[ aParent.getLength()-1] == sal_Unicode(':') && aParent.getLength() == 6 )
            aParent += rtl::OUString::createFromAscii( "/" );

        if( 0 == aParent.compareToAscii( "file://" ) )
            aParent = rtl::OUString::createFromAscii( "file:///" );

        return aParent;
    }


    osl::FileBase::RC osl_File_copy( const rtl::OUString& strPath,
                                     const rtl::OUString& strDestPath,
                                     sal_Bool test )
    {
        if( test )
        {
            osl::DirectoryItem aItem;
            if( osl::DirectoryItem::get( strDestPath,aItem ) != osl::FileBase:: E_NOENT )
                return osl::FileBase::E_EXIST;
        }

        return osl::File::copy( strPath,strDestPath );
    }


    osl::FileBase::RC osl_File_move( const rtl::OUString& strPath,
                                     const rtl::OUString& strDestPath,
                                     sal_Bool test )
    {
        if( test )
        {
            osl::DirectoryItem aItem;
            if( osl::DirectoryItem::get( strDestPath,aItem ) != osl::FileBase:: E_NOENT )
                return osl::FileBase::E_EXIST;
        }

        return osl::File::move( strPath,strDestPath );
    }


    oslFileError getResolvedURL(rtl_uString* ustrPath, rtl_uString** pustrResolvedURL)
    {
        /* TODO: If file exist and is a link get link target URL */
        rtl_uString_assign( pustrResolvedURL, ustrPath );

        return osl_File_E_None;
    }



//----------------------------------------------------------------------------
//  makeAbsolute Path
//----------------------------------------------------------------------------


    sal_Bool SAL_CALL makeAbsolutePath( const rtl::OUString&    aRelPath, rtl::OUString& aAbsPath )
    {
        sal_Int32   nIndex = 6;

        std::vector< rtl::OUString >    aTokenStack;

        // should no longer happen
        OSL_ASSERT( 0 != aRelPath.compareTo( rtl::OUString::createFromAscii( "//./" ), 4 ) );

        if ( 0 != aRelPath.compareTo( rtl::OUString::createFromAscii( "file://" ), 7 ) )
            return sal_False;

        aRelPath.getToken( 0, '/', nIndex );

        while ( nIndex >= 0 )
        {
            rtl::OUString   aToken = aRelPath.getToken( 0, '/', nIndex );

            if ( aToken.compareToAscii( ".." ) == 0 )
                aTokenStack.pop_back();
            else
                aTokenStack.push_back( aToken );
        }


        std::vector< rtl::OUString >::iterator it;
        aAbsPath = rtl::OUString::createFromAscii("file:/");

        for ( it = aTokenStack.begin(); it != aTokenStack.end(); it++ )
        {
            aAbsPath += rtl::OUString::createFromAscii( "/" );
            aAbsPath += *it;
        }

        return sal_True;
    }




    void throw_handler( shell * pShell,
                        sal_Int32 errorCode,
                        sal_Int32 minorCode,
                        const Reference< XCommandEnvironment >& xEnv,
                        const rtl::OUString& aUncPath )
    {
        Any aAny;
        IOErrorCode ioErrorCode;

        if( errorCode ==  TASKHANDLER_UNSUPPORTED_COMMAND )
        {
            aAny <<= UnsupportedCommandException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_WRONG_SETPROPERTYVALUES_ARGUMENT ||
                 errorCode == TASKHANDLING_WRONG_GETPROPERTYVALUES_ARGUMENT ||
                 errorCode == TASKHANDLING_WRONG_OPEN_ARGUMENT              ||
                 errorCode == TASKHANDLING_WRONG_DELETE_ARGUMENT            ||
                 errorCode == TASKHANDLING_WRONG_TRANSFER_ARGUMENT          ||
                 errorCode == TASKHANDLING_WRONG_INSERT_ARGUMENT )
        {
            aAny <<= IllegalArgumentException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_UNSUPPORTED_OPEN_MODE )
        {
            aAny <<= UnsupportedOpenModeException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND  ||
                 errorCode == TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND ||
                 errorCode == TASKHANDLING_NOFRESHINSERT_IN_INSERT_COMMAND )
        {

        }
        else if( errorCode == TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE ||  // error in opening file
                 errorCode == TASKHANDLING_NO_OPEN_FILE_FOR_WRITE     ||  // error in opening file
                 errorCode == TASKHANDLING_OPEN_FOR_STREAM            ||  // error in opening file
                 errorCode == TASKHANDLING_OPEN_FOR_INPUTSTREAM       ||  // error in opening file
                 errorCode == TASKHANDLING_OPEN_FILE_FOR_PAGING )        // error in opening file
        {
            switch( minorCode )
            {
            case FileBase::E_NAMETOOLONG:       // pathname was too long<br>
                ioErrorCode = IOErrorCode_NAME_TOO_LONG;
                break;
            case FileBase::E_NXIO:          // No such device or address<br>
            case FileBase::E_NODEV:         // No such device<br>
                ioErrorCode = IOErrorCode_INVALID_DEVICE;
                break;
            case FileBase::E_NOENT:         // No such file or directory<br>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            case FileBase::E_ACCES:         // permission denied<P>
                ioErrorCode = IOErrorCode_ACCESS_DENIED;
                break;
            case FileBase::E_ISDIR:         // Is a directory<p>
                ioErrorCode = IOErrorCode_NO_FILE;
                break;
            case FileBase::E_MFILE:         // too many open files used by the process<br>
            case FileBase::E_NFILE:         // too many open files in the system<br>
                ioErrorCode = IOErrorCode_OUT_OF_FILE_HANDLES;
                break;
            case FileBase::E_INVAL:         // the format of the parameters was not valid<br>
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_NOMEM:         // not enough memory for allocating structures <br>
                ioErrorCode = IOErrorCode_OUT_OF_MEMORY;
                break;
            case FileBase::E_BUSY:          // Text file busy<br>
                ioErrorCode = IOErrorCode_LOCKING_VIOLATION;
                break;
            case FileBase::E_FAULT:         // Bad address<br>
            case FileBase::E_LOOP:          // Too many symbolic links encountered<br>
            case FileBase::E_NOSPC:         // No space left on device<br>
            case FileBase::E_INTR:          // function call was interrupted<br>
            case FileBase::E_IO:            // I/O error<br>
            case FileBase::E_MULTIHOP:      // Multihop attempted<br>
            case FileBase::E_NOLINK:        // Link has been severed<br>
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }

            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_OPEN_FOR_DIRECTORYLISTING  ||
                 errorCode == TASKHANDLING_OPENDIRECTORY_FOR_REMOVE )
        {
            switch( minorCode )
            {
            case FileBase::E_INVAL:          // the format of the parameters was not valid<br>
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_NOENT:          // the specified path doesn't exist<br>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            case FileBase::E_NOTDIR:             // the specified path is not an directory <br>
                ioErrorCode = IOErrorCode_NO_DIRECTORY;
                break;
            case FileBase::E_NOMEM:          // not enough memory for allocating structures <br>
                ioErrorCode = IOErrorCode_OUT_OF_MEMORY;
                break;
            case FileBase::E_ACCES:          // permission denied<br>
                ioErrorCode = IOErrorCode_ACCESS_DENIED;
                break;
            case FileBase::E_MFILE:          // too many open files used by the process<br>
            case FileBase::E_NFILE:          // too many open files in the system<br>
                ioErrorCode = IOErrorCode_OUT_OF_FILE_HANDLES;
                break;
            case FileBase::E_NAMETOOLONG:        // File name too long<br>
                ioErrorCode = IOErrorCode_NAME_TOO_LONG;
                break;
            case FileBase::E_LOOP:           // Too many symbolic links encountered<p>
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }

            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_NOTCONNECTED_FOR_WRITE          ||
                 errorCode == TASKHANDLING_BUFFERSIZEEXCEEDED_FOR_WRITE    ||
                 errorCode == TASKHANDLING_IOEXCEPTION_FOR_WRITE           ||
                 errorCode == TASKHANDLING_NOTCONNECTED_FOR_PAGING         ||
                 errorCode == TASKHANDLING_BUFFERSIZEEXCEEDED_FOR_PAGING   ||
                 errorCode == TASKHANDLING_IOEXCEPTION_FOR_PAGING         )
        {
            ioErrorCode = IOErrorCode_UNKNOWN;
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_FILEIOERROR_FOR_WRITE ||
                 errorCode == TASKHANDLING_READING_FILE_FOR_PAGING )
        {
            switch( minorCode )
            {
            case FileBase::E_INVAL:             // the format of the parameters was not valid
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_FBIG:              // File too large<br>
                ioErrorCode = IOErrorCode_CANT_WRITE;
                break;
            case FileBase::E_NOSPC:             // No space left on device<br>
                ioErrorCode = IOErrorCode_OUT_OF_DISK_SPACE;
                break;
            case FileBase::E_NXIO:              // No such device or address<p>
                ioErrorCode = IOErrorCode_INVALID_DEVICE;
                break;
            case FileBase::E_NOLINK:            // Link has been severed<p>
            case FileBase::E_ISDIR:             // Is a directory<br>
                ioErrorCode = IOErrorCode_NO_FILE;
                break;
            case FileBase::E_NOLCK:             // No record locks available<br>
            case FileBase::E_IO:                // I/O error<br>
            case FileBase::E_BADF:              // Bad file<br>
            case FileBase::E_FAULT:             // Bad address<br>
            case FileBase::E_AGAIN:             // Operation would block<br>
            case FileBase::E_INTR:              // function call was interrupted<br>
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_NONAMESET_INSERT_COMMAND ||
                 errorCode == TASKHANDLING_NOCONTENTTYPE_INSERT_COMMAND )
        {
            Sequence< ::rtl::OUString > aSeq( 1 );
            aSeq[0] =
                ( errorCode == TASKHANDLING_NONAMESET_INSERT_COMMAND )  ?
                rtl::OUString::createFromAscii( "Title" )               :
                rtl::OUString::createFromAscii( "ContentType" );

            aAny <<= MissingPropertiesException( rtl::OUString(),
                                                 0,
                                                 aSeq );
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_FILESIZE_FOR_WRITE )
        {
            switch( minorCode )
            {
            case FileBase::E_INVAL:     // the format of the parameters was not valid<br>
            case FileBase::E_OVERFLOW:  // The resulting file offset would be a value which cannot
                //                      //  be represented correctly for regular files
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_INPUTSTREAM_FOR_WRITE )
        {
            aAny <<= MissingInputStreamException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_NOREPLACE_FOR_WRITE )    // Overwrite = false and file exists
        {
            aAny <<= NameClashException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_ENSUREDIR_FOR_WRITE  ||
                 errorCode == TASKHANDLING_CREATEDIRECTORY_MKDIR )
        {
            ioErrorCode = IOErrorCode_NOT_EXISTING_PATH;
            cancelCommandExecution(
                ioErrorCode,
                generateErrorArguments(pShell, getParentName(aUncPath)),
                    //TODO! ok to supply physical URL to getParentName()?
                xEnv );
        }
        else if( errorCode == TASKHANDLING_VALIDFILESTATUSWHILE_FOR_REMOVE  ||
                 errorCode == TASKHANDLING_VALIDFILESTATUS_FOR_REMOVE       ||
                 errorCode == TASKHANDLING_NOSUCHFILEORDIR_FOR_REMOVE )
        {
            switch( minorCode )
            {
            case FileBase::E_INVAL:         // the format of the parameters was not valid<br>
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_NOMEM:         // not enough memory for allocating structures <br>
                ioErrorCode = IOErrorCode_OUT_OF_MEMORY;
                break;
            case FileBase::E_ACCES:         // permission denied<br>
                ioErrorCode = IOErrorCode_ACCESS_DENIED;
                break;
            case FileBase::E_MFILE:         // too many open files used by the process<br>
            case FileBase::E_NFILE:         // too many open files in the system<br>
                ioErrorCode = IOErrorCode_OUT_OF_FILE_HANDLES;
                break;
            case FileBase::E_NOLINK:        // Link has been severed<br>
            case FileBase::E_NOENT:         // No such file or directory<br>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            case FileBase::E_NAMETOOLONG:   // File name too long<br>
                ioErrorCode = IOErrorCode_NAME_TOO_LONG;
                break;
            case FileBase::E_NOTDIR:     // A component of the path prefix of path is not a directory
                ioErrorCode = IOErrorCode_NOT_EXISTING_PATH;
                break;
            case FileBase::E_LOOP:          // Too many symbolic links encountered<br>
            case FileBase::E_IO:            // I/O error<br>
            case FileBase::E_MULTIHOP:      // Multihop attempted<br>
            case FileBase::E_FAULT:         // Bad address<br>
            case FileBase::E_INTR:          // function call was interrupted<p>
            case FileBase::E_NOSYS:         // Function not implemented<p>
            case FileBase::E_NOSPC:         // No space left on device<br>
            case FileBase::E_NXIO:          // No such device or address<br>
            case FileBase::E_OVERFLOW:      // Value too large for defined data type<br>
            case FileBase::E_BADF:          // Invalid oslDirectoryItem parameter<br>
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_DELETEFILE_FOR_REMOVE  ||
                 errorCode == TASKHANDLING_DELETEDIRECTORY_FOR_REMOVE )
        {
            switch( minorCode )
            {
            case FileBase::E_INVAL:         // the format of the parameters was not valid<br>
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_NOMEM:         // not enough memory for allocating structures <br>
                ioErrorCode = IOErrorCode_OUT_OF_MEMORY;
                break;
            case FileBase::E_ACCES:         // Permission denied<br>
                ioErrorCode = IOErrorCode_ACCESS_DENIED;
                break;
            case FileBase::E_PERM:          // Operation not permitted<br>
                ioErrorCode = IOErrorCode_NOT_SUPPORTED;
                break;
            case FileBase::E_NAMETOOLONG:   // File name too long<br>
                ioErrorCode = IOErrorCode_NAME_TOO_LONG;
                break;
            case FileBase::E_NOLINK:        // Link has been severed<br>
            case FileBase::E_NOENT:         // No such file or directory<br>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            case FileBase::E_ISDIR:         // Is a directory<br>
            case FileBase::E_ROFS:          // Read-only file system<p>
                ioErrorCode = IOErrorCode_NOT_SUPPORTED;
                break;
            case FileBase::E_BUSY:          // Device or resource busy<br>
                ioErrorCode = IOErrorCode_LOCKING_VIOLATION;
                break;
            case FileBase::E_FAULT:         // Bad address<br>
            case FileBase::E_LOOP:          // Too many symbolic links encountered<br>
            case FileBase::E_IO:            // I/O error<br>
            case FileBase::E_INTR:          // function call was interrupted<br>
            case FileBase::E_MULTIHOP:      // Multihop attempted<br>
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_TRANSFER_MOUNTPOINTS )
        {
            ioErrorCode = IOErrorCode_NOT_EXISTING;
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_TRANSFER_BY_COPY_SOURCE         ||
                 errorCode == TASKHANDLING_TRANSFER_BY_COPY_SOURCESTAT     ||
                 errorCode == TASKHANDLING_TRANSFER_BY_MOVE_SOURCE         ||
                 errorCode == TASKHANDLING_TRANSFER_BY_MOVE_SOURCESTAT     ||
                 errorCode == TASKHANDLING_TRANSFER_DESTFILETYPE           ||
                 errorCode == TASKHANDLING_FILETYPE_FOR_REMOVE             ||
                 errorCode == TASKHANDLING_DIRECTORYEXHAUSTED_FOR_REMOVE   ||
                 errorCode == TASKHANDLING_TRANSFER_INVALIDURL )
        {
            ioErrorCode = IOErrorCode_GENERAL;
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_TRANSFER_ACCESSINGROOT )
        {
            ioErrorCode = IOErrorCode_WRITE_PROTECTED;
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_TRANSFER_INVALIDSCHEME )
        {
            aAny <<= InteractiveBadTransferURLException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_OVERWRITE_FOR_MOVE      ||
                 errorCode == TASKHANDLING_OVERWRITE_FOR_COPY      ||
                 errorCode == TASKHANDLING_NAMECLASHMOVE_FOR_MOVE  ||
                 errorCode == TASKHANDLING_NAMECLASHMOVE_FOR_COPY  ||
                 errorCode == TASKHANDLING_KEEPERROR_FOR_MOVE      ||
                 errorCode == TASKHANDLING_KEEPERROR_FOR_COPY      ||
                 errorCode == TASKHANDLING_RENAME_FOR_MOVE         ||
                 errorCode == TASKHANDLING_RENAME_FOR_COPY         ||
                 errorCode == TASKHANDLING_RENAMEMOVE_FOR_MOVE     ||
                 errorCode == TASKHANDLING_RENAMEMOVE_FOR_COPY    )
        {
            switch( minorCode )
            {
            case FileBase::E_EXIST:
                ioErrorCode = IOErrorCode_ALREADY_EXISTING;
                break;
            case FileBase::E_INVAL:         // the format of the parameters was not valid<br>
                ioErrorCode = IOErrorCode_INVALID_PARAMETER;
                break;
            case FileBase::E_NOMEM:         // not enough memory for allocating structures <br>
                ioErrorCode = IOErrorCode_OUT_OF_MEMORY;
                break;
            case FileBase::E_ACCES:         // Permission denied<br>
                ioErrorCode = IOErrorCode_ACCESS_DENIED;
                break;
            case FileBase::E_PERM:          // Operation not permitted<br>
                ioErrorCode = IOErrorCode_NOT_SUPPORTED;
                break;
            case FileBase::E_NAMETOOLONG:   // File name too long<br>
                ioErrorCode = IOErrorCode_NAME_TOO_LONG;
                break;
            case FileBase::E_NOENT:         // No such file or directory<br>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            case FileBase::E_ROFS:          // Read-only file system<p>
                ioErrorCode = IOErrorCode_NOT_EXISTING;
                break;
            default:
                ioErrorCode = IOErrorCode_GENERAL;
                break;
            }
            cancelCommandExecution( ioErrorCode,
                                    generateErrorArguments(pShell, aUncPath),
                                    xEnv );
        }
        else if( errorCode == TASKHANDLING_NAMECLASH_FOR_COPY   ||
                 errorCode == TASKHANDLING_NAMECLASH_FOR_MOVE )
        {
            aAny <<= NameClashException();
            cancelCommandExecution( aAny,xEnv );
        }
        else if( errorCode == TASKHANDLING_NAMECLASHSUPPORT_FOR_MOVE   ||
                 errorCode == TASKHANDLING_NAMECLASHSUPPORT_FOR_COPY )
        {
            aAny <<= UnsupportedNameClashException();
            cancelCommandExecution( aAny,xEnv );
        }
        else
        {
            // case TASKHANDLER_NO_ERROR:
            return;
        }
    }


}   // end namespace fileaccess