CRsfwRemoteAccess Class Reference

class CRsfwRemoteAccess : public CBase

Class for accessing files via a file transport protocol, like WebDAV.

rsfwcommon.lib
Since
Series 60 3.1
The derived classes are supposed to be registered and instantiated by using the the ECOM architecture.

Inherits from

Public Member Functions
~CRsfwRemoteAccess()
voidCancel(TUint)
voidCancel(TDesC &)
TUint CreateFileL(const TDesC &, TBool, MRsfwRemoteAccessResponseHandler *)
TUint DeleteDirectoryL(const TDesC &, MRsfwRemoteAccessResponseHandler *)
TUint DeleteFileL(const TDesC &, MRsfwRemoteAccessResponseHandler *)
TUint GetDirectoryAttributesL(const TDesC &, CRsfwDirEntAttr *&, MRsfwRemoteAccessResponseHandler *)
TUint GetDirectoryL(const TDesC &, RPointerArray< CRsfwDirEnt > &, MRsfwRemoteAccessResponseHandler *)
TUint GetFileAttributesL(const TDesC &, CRsfwDirEntAttr *&, MRsfwRemoteAccessResponseHandler *)
TUint GetFileL(const TDesC &, const TDesC &, TInt, TInt *, TUint, MRsfwRemoteAccessResponseHandler *)
IMPORT_C TIntGetQuotaAndSizeL(TInt &, TInt &)
TUint MakeDirectoryL(const TDesC &, MRsfwRemoteAccessResponseHandler *)
IMPORT_C CRsfwRemoteAccess *NewL(const TDesC8 &)
TUint ObtainLockL(const TDesC &, TUint, TUint &, TDesC8 *&, MRsfwRemoteAccessResponseHandler *)
TUint OpenL(const TUriC &, const TDesC &, const TDesC &, const TDesC &, const TDesC &, MRsfwRemoteAccessResponseHandler *)
TUint PutFileL(const TDesC &, const TDesC &, const TDesC8 &, TInt, TInt, TInt, MRsfwRemoteAccessResponseHandler *)
TUint PutFileL(const TDesC &, const TDesC &, const TDesC8 &, MRsfwRemoteAccessResponseHandler *)
TUint RefreshLockL(const TDesC &, TUint &, MRsfwRemoteAccessResponseHandler *)
TUint ReleaseLockL(const TDesC &, MRsfwRemoteAccessResponseHandler *)
TUint RenameL(const TDesC &, const TDesC &, TBool, MRsfwRemoteAccessResponseHandler *)
TUint SetAttributesL(const TDesC &, CRsfwDirEntAttr &, MRsfwRemoteAccessResponseHandler *)
TInt SetLockToken(const TDesC &, const TDesC8 &)
voidSetupL(MRsfwRemoteAccessObserver *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TUid iDtor_ID_Key

Constructor & Destructor Documentation

~CRsfwRemoteAccess()

IMPORT_C~CRsfwRemoteAccess()[virtual]

Member Functions Documentation

Cancel(TUint)

voidCancel(TUintaId)[pure virtual]

Cancels a transaction Eventually the HandleRemoteAccessResponseL will be called with status KErrCancel

Parameters

TUint aIdthe identifier of the transaction to be canceled. If aId is zero, all pending requests are cancelled.

Cancel(TDesC &)

voidCancel(TDesC &aTargetPath)[pure virtual]

Cancels a transaction Eventually the HandleRemoteAccessResponseL will be called with status KErrCancel

Parameters

TDesC & aTargetPaththe path of the target file or directory for the operation that shall be cancelled

CreateFileL(const TDesC &, TBool, MRsfwRemoteAccessResponseHandler *)

TUint CreateFileL(const TDesC &aPathName,
TBoolaOverWriting,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Creates an empty file on the remote server

Parameters

const TDesC & aPathNamepath name of the new file
TBool aOverWritingwhether we are overwriting an existing file Note that the semantics of this operation is such that it must always overwrite an existing file. This boolean is for information. If the protocol requires additional parameter to allow overwriting, the parameter should be set if aOverWriting is TRUE.
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

DeleteDirectoryL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

TUint DeleteDirectoryL(const TDesC &aPathName,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Deletes a directory.

Parameters

const TDesC & aPathNamepath name of the directory to be deleted
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

DeleteFileL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

TUint DeleteFileL(const TDesC &aPathName,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Deletes a file.

Parameters

const TDesC & aPathNamepath name of the file to be deleted
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

GetDirectoryAttributesL(const TDesC &, CRsfwDirEntAttr *&, MRsfwRemoteAccessResponseHandler *)

TUint GetDirectoryAttributesL(const TDesC &aPathName,
CRsfwDirEntAttr *&aAttr,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Gets attributes of the directory given by aPathName parameter. This function may also be called if the type of the object is not yet known (e.g., the object could be a file).

Parameters

const TDesC & aPathNamepath name of the directory
CRsfwDirEntAttr *& aAttrA pointer to the attribute object to be filled. This attribute is set to point to a newly created CRsfwDirEntAttr object that will contain the directory attributes. In the created attribute object, pointers to descriptors for meta-data items that are not available or that are irrelevant are set to NULL value. The ownership of the object is transferred to the caller. If the attributes cannot be defined, the pointer will be set to NULL.
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

GetDirectoryL(const TDesC &, RPointerArray< CRsfwDirEnt > &, MRsfwRemoteAccessResponseHandler *)

TUint GetDirectoryL(const TDesC &aPathName,
RPointerArray< CRsfwDirEnt > &aDirEntsp,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Gets contents of the directory given by aPathName parameter.

Parameters

const TDesC & aPathNamepath name of the directory
RPointerArray< CRsfwDirEnt > & aDirEntsp
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

GetFileAttributesL(const TDesC &, CRsfwDirEntAttr *&, MRsfwRemoteAccessResponseHandler *)

TUint GetFileAttributesL(const TDesC &aPathName,
CRsfwDirEntAttr *&aAttr,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Gets attributes of the file given by aPathName parameter.

Parameters

const TDesC & aPathNamepath name of the file
CRsfwDirEntAttr *& aAttrA pointer to the attribute object to be filled. This attribute is set to point to a newly created CRsfwDirEntAttr object that will contain the file attributes. In the created attribute object, pointers to descriptors for meta-data items that are not available or that are irrelevant are set to NULL value. The ownership of the object is transferred to the caller. If the attributes cannot be defined, the pointer will be set to NULL.
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

GetFileL(const TDesC &, const TDesC &, TInt, TInt *, TUint, MRsfwRemoteAccessResponseHandler *)

TUint GetFileL(const TDesC &aRemotePathName,
const TDesC &aLocalPathName,
TIntaOffset,
TInt *aLength,
TUintaFlags,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Gets a remote file and copies it to a local file. Note that byte ranges are not be implemented by all file access protocols. A non-zero aLength means partial get. Caller can assume that either aLength remains intact in which case byte range offset + aLength was fetched, or aLength is reset to the full length of the file, in which case aOffset is meaningless.

Parameters

const TDesC & aRemotePathNamepath name of the remote file
const TDesC & aLocalPathNamepath name of the local file
TInt aOffsetoffset of the first byte to be accessed
TInt * aLengthlength of data to be accessed/was accessed (on entry NULL or zero value means fetching the whole file - on exit contains the length of fetched data, unless the pointer is NULL)
TUint aFlagsoperation qualifier. The following flags have been defined: KRemoteAccessOptionGetToStartOfFile: even if an offset is specified the fetched data is still put at the beginning of the local file.
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

GetQuotaAndSizeL(TInt &, TInt &)

IMPORT_C TIntGetQuotaAndSizeL(TInt &aQuota,
TInt &aSize
)[virtual]

Gets quota and size.

Parameters

TInt & aQuotaThe maximum size of the drive for this user in bytes,
TInt & aSizeThe amount of free space for this user on the disk in bytes.

MakeDirectoryL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

TUint MakeDirectoryL(const TDesC &aPathName,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Makes a directory.

Parameters

const TDesC & aPathNamepath name of the new directory
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

NewL(const TDesC8 &)

IMPORT_C CRsfwRemoteAccess *NewL(const TDesC8 &aProtocol)[static]

Two-phased constructor.

Parameters

const TDesC8 & aProtocolprotocol name, like "http", "https", or "ftp"

ObtainLockL(const TDesC &, TUint, TUint &, TDesC8 *&, MRsfwRemoteAccessResponseHandler *)

TUint ObtainLockL(const TDesC &aPathName,
TUintaLockFlags,
TUint &aTimeout,
TDesC8 *&aLockToken,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Obtains a lock for the given file system object Note that this function is not be implemented by all file access protocols (e.g. FTP), some protocols only implement write locking (e.g. WebDAV).

Parameters

const TDesC & aPathNamepath name of the object to be locked
TUint aLockFlagsindicates whether a write or read lock is requested
TUint & aTimeoutthe timeout that is requested and granted (in seconds)
TDesC8 *& aLockTokenacquired lock token - the caller gets ownership
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

OpenL(const TUriC &, const TDesC &, const TDesC &, const TDesC &, const TDesC &, MRsfwRemoteAccessResponseHandler *)

TUint OpenL(const TUriC &aUri,
const TDesC &aFriendlyName,
const TDesC &aUserName,
const TDesC &aPassword,
const TDesC &aAuxData,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Opens a connection to the server given by aServerName parameter.

Parameters

const TUriC & aUriURI of the remote repository. The URI must not contain authority part (user name/password)
const TDesC & aFriendlyNamefriendly name for the server (for possible access control dialog) (can be empty)
const TDesC & aUserNameuser name for access control (can be empty)
const TDesC & aPasswordpassword for access control (can be empty)
const TDesC & aAuxDataauxiliary parameters for connection setup (eg IAP info)
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

PutFileL(const TDesC &, const TDesC &, const TDesC8 &, TInt, TInt, TInt, MRsfwRemoteAccessResponseHandler *)

TUint PutFileL(const TDesC &aLocalPathName,
const TDesC &aRemotePathName,
const TDesC8 &aMimeType,
TIntaOffset,
TIntaLength,
TIntaTotalLength,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Puts a range of a file to the server. A non-zero aLength means partial file putting. The access protocol/server doesn't have to support partial file putting. In this case, it should return KErrNotSupported (if aLength is not zero)

Parameters

const TDesC & aLocalPathNamepath name of the local file
const TDesC & aRemotePathNamepath name of the remote file
const TDesC8 & aMimeType
TInt aOffsetoffset of the first byte to be accessed
TInt aLengthlength of data to be accessed/was accessed (NULL/0=all)
TInt aTotalLengthtotal length of the file, set to 0 if not known
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

PutFileL(const TDesC &, const TDesC &, const TDesC8 &, MRsfwRemoteAccessResponseHandler *)

TUint PutFileL(const TDesC &aLocalPathName,
const TDesC &aRemotePathName,
const TDesC8 &aMimeType,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Puts a file to the server.

Parameters

const TDesC & aLocalPathNamepath name of the local file
const TDesC & aRemotePathNamepath name of the remote file
const TDesC8 & aMimeType
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

RefreshLockL(const TDesC &, TUint &, MRsfwRemoteAccessResponseHandler *)

TUint RefreshLockL(const TDesC &aPathName,
TUint &aTimeout,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Refreshes the lock of the given file system object Note that this function is not be implemented by all file access protocols (e.g. FTP).

Parameters

const TDesC & aPathNamepath name of the object to be locked
TUint & aTimeoutthe timeout that is requested and granted (in seconds)
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

ReleaseLockL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

TUint ReleaseLockL(const TDesC &aPathName,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Releases the lock of the given file system object Note that this function is not be implemented by all file access protocols (e.g. FTP).

Parameters

const TDesC & aPathNamepath name of the object to be locked
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

RenameL(const TDesC &, const TDesC &, TBool, MRsfwRemoteAccessResponseHandler *)

TUint RenameL(const TDesC &aSrcPathName,
const TDesC &aDstPathName,
TBoolaOverwrite,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Renames a file or a directory. (may involve movement to another directory).

Parameters

const TDesC & aSrcPathNamepath name of the object to be renamed
const TDesC & aDstPathNamenew path name of the object
TBool aOverwriteallow overwriting an existing object
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

SetAttributesL(const TDesC &, CRsfwDirEntAttr &, MRsfwRemoteAccessResponseHandler *)

TUint SetAttributesL(const TDesC &aPathName,
CRsfwDirEntAttr &aAttr,
MRsfwRemoteAccessResponseHandler *aResponseHandler
)[pure virtual]

Sets attributes of the file or directory given by aPathName parameter. This function is typically only used for files and even then the implementation may do nothing since standard file attributes are implied by the contents of the file or set in conjunction with other operations on the file system object.

Parameters

const TDesC & aPathNamepath name of the file or directory
CRsfwDirEntAttr & aAttrattribute structure
MRsfwRemoteAccessResponseHandler * aResponseHandlerresponse handler

SetLockToken(const TDesC &, const TDesC8 &)

TInt SetLockToken(const TDesC &aPathName,
const TDesC8 &aLockToken
)[pure virtual]

Sets lock token for the a given resource This lock token value replaces any previously cached token value

Parameters

const TDesC & aPathNamepath name
const TDesC8 & aLockTokenlock token

SetupL(MRsfwRemoteAccessObserver *)

voidSetupL(MRsfwRemoteAccessObserver *aRsfwRemoteAccessObserver)[pure virtual]

Set up parameters for operation.

Parameters

MRsfwRemoteAccessObserver * aRsfwRemoteAccessObserverMRsfwRemoteAccessObserver for receiving asynchronous events from the accessor plugin, e.g. changes in connectivity. This parameter may be NULL

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key[private]