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 ()
void Cancel ( TUint )
void Cancel ( 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 TInt GetQuotaAndSizeL ( 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 &)
void SetupL ( 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)

void Cancel ( TUint aId ) [pure virtual]

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

Parameters

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

Cancel(TDesC &)

void Cancel ( TDesC & aTargetPath ) [pure virtual]

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

Parameters

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

CreateFileL(const TDesC &, TBool, MRsfwRemoteAccessResponseHandler *)

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

Creates an empty file on the remote server

Parameters

const TDesC & aPathName path name of the new file
TBool aOverWriting whether 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 * aResponseHandler response handler

DeleteDirectoryL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

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

Deletes a directory.

Parameters

const TDesC & aPathName path name of the directory to be deleted
MRsfwRemoteAccessResponseHandler * aResponseHandler response handler

DeleteFileL(const TDesC &, MRsfwRemoteAccessResponseHandler *)

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

Deletes a file.

Parameters

const TDesC & aPathName path name of the file to be deleted
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name of the directory
CRsfwDirEntAttr *& aAttr A 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 * aResponseHandler response 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 & aPathName path name of the directory
RPointerArray < CRsfwDirEnt > & aDirEntsp
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name of the file
CRsfwDirEntAttr *& aAttr A 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 * aResponseHandler response handler

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

TUint GetFileL ( const TDesC & aRemotePathName,
const TDesC & aLocalPathName,
TInt aOffset,
TInt * aLength,
TUint aFlags,
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 & aRemotePathName path name of the remote file
const TDesC & aLocalPathName path name of the local file
TInt aOffset offset of the first byte to be accessed
TInt * aLength length 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 aFlags operation 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 * aResponseHandler response handler

GetQuotaAndSizeL(TInt &, TInt &)

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

Gets quota and size.

Parameters

TInt & aQuota The maximum size of the drive for this user in bytes,
TInt & aSize The 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 & aPathName path name of the new directory
MRsfwRemoteAccessResponseHandler * aResponseHandler response handler

NewL(const TDesC8 &)

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

Two-phased constructor.

Parameters

const TDesC8 & aProtocol protocol name, like "http", "https", or "ftp"

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

TUint ObtainLockL ( const TDesC & aPathName,
TUint aLockFlags,
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 & aPathName path name of the object to be locked
TUint aLockFlags indicates whether a write or read lock is requested
TUint & aTimeout the timeout that is requested and granted (in seconds)
TDesC8 *& aLockToken acquired lock token - the caller gets ownership
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aUri URI of the remote repository. The URI must not contain authority part (user name/password)
const TDesC & aFriendlyName friendly name for the server (for possible access control dialog) (can be empty)
const TDesC & aUserName user name for access control (can be empty)
const TDesC & aPassword password for access control (can be empty)
const TDesC & aAuxData auxiliary parameters for connection setup (eg IAP info)
MRsfwRemoteAccessResponseHandler * aResponseHandler response handler

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

TUint PutFileL ( const TDesC & aLocalPathName,
const TDesC & aRemotePathName,
const TDesC8 & aMimeType,
TInt aOffset,
TInt aLength,
TInt aTotalLength,
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 & aLocalPathName path name of the local file
const TDesC & aRemotePathName path name of the remote file
const TDesC8 & aMimeType
TInt aOffset offset of the first byte to be accessed
TInt aLength length of data to be accessed/was accessed (NULL/0=all)
TInt aTotalLength total length of the file, set to 0 if not known
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aLocalPathName path name of the local file
const TDesC & aRemotePathName path name of the remote file
const TDesC8 & aMimeType
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name of the object to be locked
TUint & aTimeout the timeout that is requested and granted (in seconds)
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name of the object to be locked
MRsfwRemoteAccessResponseHandler * aResponseHandler response handler

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

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

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

Parameters

const TDesC & aSrcPathName path name of the object to be renamed
const TDesC & aDstPathName new path name of the object
TBool aOverwrite allow overwriting an existing object
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name of the file or directory
CRsfwDirEntAttr & aAttr attribute structure
MRsfwRemoteAccessResponseHandler * aResponseHandler response 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 & aPathName path name
const TDesC8 & aLockToken lock token

SetupL(MRsfwRemoteAccessObserver *)

void SetupL ( MRsfwRemoteAccessObserver * aRsfwRemoteAccessObserver ) [pure virtual]

Set up parameters for operation.

Parameters

MRsfwRemoteAccessObserver * aRsfwRemoteAccessObserver MRsfwRemoteAccessObserver 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]