class TMsvServerStoreManager : public MMsvStoreManager |
Provides implementation of the File Access APIs at the server-side. This class has direct access to the Message store, unlike the client version of it. This can be used by the server side classed to access the store and attachment entries.
MMsvStoreManager , TMsvServerStoreManager implements MMsvStoreManager
Private Member Functions | |
---|---|
TBool | CheckFileNameLengthAndTrimL (const TDesC &, TDes &) |
TBool | CreateAttachmentL ( TMsvId , TDes &, RFile &, RFs &, TBool ) |
TBool | GenerateFileNameIfExistsL ( TDes &) |
TInt | GetFilePath ( TMsvId , TFileName &) |
void | GetOwningServiceAndFilePath ( TMsvId , TDes &, TMsvId &) |
void | GetStoreFileName ( TMsvId , TFileName &) |
Private Attributes | |
---|---|
RFs * | iFs |
CMsvServer * | iMsvServer |
void | AttachmentFilePathL | ( | TMsvId | aEntryId, |
TDes & | aFilePath | |||
) | [virtual] |
Queries the message server for the file path where attachments are stored for the a particular message entry.
void | BodyTextFilePathL | ( | TMsvId | aBodyTextId, |
TDes & | aFilePath | |||
) | [virtual] |
Gets the path for the file in message store for which the message Id is passed.
TBool | CheckFileNameLengthAndTrimL | ( | const TDesC & | aFilePath, |
TDes & | aFileName | |||
) | [private] |
Checks if the filename length is greater than KMaxFileName(256)
If the filename is greater than KMaxFileName then it truncates the filename
TBool | CreateAttachmentForWriteL | ( | TMsvId | aEntryId, |
TDes & | aFilename, | |||
RFile & | aFile | |||
) | [virtual] |
Allows clients to create a new empty file and allows clients to stream data to it.
Creates a new attachment file in the message store for the message entry specified by the aEntryId parameter. The attachment filename is set to the filename indicated by the aFilename parameter. The empty attachment file is passed back to the client using an opened file handle to the file in the message store.
TMsvId aEntryId | The entry for which an attachment needs to be created in the message store |
TDes & aFilename | The name of the attachment file to be created |
RFile & aFile | On return, The created file handle for the attachment file.The ownership is transferred . The caller must close the file handle. |
TBool | CreateAttachmentL | ( | TMsvId | aEntryId, |
TDes & | aFilename, | |||
RFile & | aFile, | |||
RFs & | aFs, | |||
TBool | aSharedAccess = EFalse | |||
) | [private] |
void | CreatePlainTextFileL | ( | RFile & | aFile, |
TMsvId | aBodyTextId | |||
) | [virtual] |
Creates the RFile in the aFilepath is passed.
TBool | CreateShareProtectedAttachmentForWriteL | ( | TMsvId | aEntryId, |
TDes & | aFilename, | |||
RFile & | aFile | |||
) | [virtual] |
Creates an Attachment using a ShareProtected RFs.Used in the case when a message contains a DRM attachment
TMsvId aEntryId | The entry for which an attachment needs to be created in the message store |
TDes & aFilename | The name of the attachment file to be created |
RFile & aFile | On return, The created file handle for the attachment file.The ownership is transferred . The caller must close the file handle. |
TInt | DeleteAttachment | ( | TMsvId | aEntryId, |
const TDesC & | aFilePath | |||
) | [virtual] |
Allow clients to delete existing attachment files.
Deletes an existing attachment file in the message store associated with the message entry specified by the aEntryId parameter. The attachment is identified by the file path specified by the aFilePath parameter.
void | DeleteFileStoreL | ( | TMsvId | aEntryId | ) | [virtual] |
Deletes the store file associated with the message entry as specified by the aEntryId. Also attempts to delete the temporary store file if one exists.
TMsvId aEntryId | The entry whose store needs to be deleted |
void | DeletePlainTextFileL | ( | TMsvId | aBodyTextId | ) | [virtual] |
Deletes the RFile in the aFilepath passed.
TMsvId aBodyTextId | The Id of the bodytext. |
TBool | FileExistsL | ( | const TDesC & | aFilePath | ) | [virtual] |
Check if an attachment file with the given path and name already exists.
const TDesC & aFilePath | The full path specification of the file. |
TBool | FileStoreExistsL | ( | TMsvId | aEntryId | ) | const [virtual] |
Queries the message server to check if a store file exists for the message entry specified by the aEntryId parameter.
TMsvId aEntryId | The entry for whom the check for existance of store is being done |
TBool | GenerateFileNameIfExistsL | ( | TDes & | aFileName | ) | [private] |
TDes & aFileName |
TInt | GetFilePath | ( | TMsvId | aEntryId, |
TFileName & | aDirectory | |||
) | const [private] |
Gets the filepath for the storage of binary files associated with the context
If the directory specified in the context does not exist, it is created.
void | GetOwningServiceAndFilePath | ( | TMsvId | aEntryId, |
TDes & | aFilePath, | |||
TMsvId & | aOwningService | |||
) | const [private] |
void | GetStoreFileName | ( | TMsvId | aEntryId, |
TFileName & | aFileName | |||
) | const [private] |
Gets the filestore name associated with the context
void | OpenAttachmentForWriteL | ( | TMsvId | aEntryId, |
const TDesC & | aFilePath, | |||
RFile & | aFile | |||
) | [virtual] |
Allows clients to open an attachment file for writing.
Opens an existing attachment file in the message associated with the message entry specified by the aEntryId parameter. The attachment is identified by the file path specified by the aFilePath parameter. The attachment file is returned as a read/write file handle to the file in the message store.
TMsvId aEntryId | The entry whose attachment needs to be opened/read from the message store |
const TDesC & aFilePath | The name and path of the attachment file to be opened |
RFile & aFile | On return, The opened file handle for the attachment file.The ownership is transferred . The caller must close the file handle. |
void | OpenAttachmentL | ( | TMsvId | aEntryId, |
const TDesC & | aFilePath, | |||
RFile & | aFile | |||
) | [virtual] |
Allows clients to view attachment files.
Opens an existing attachment file in the message associated with the message entry specified by the aEntryId parameter. The attachment is identified by the file path specified by the aFilePath parameter. The attachment file is returned as a read-only file handle to the file in the message store.
TMsvId aEntryId | The entry whose attachment needs to be opened/read from the message store |
const TDesC & aFilePath | The name and path of the attachment file to be opened |
RFile & aFile | On return, The opened file handle for the attachment file.The ownership is transferred . The caller must close the file handle. |
void | OpenBodyTextFileForReadL | ( | RFile & | aFile, |
TMsvId | aBodyTextId, | |||
const TDesC & | aFilePath | |||
) | [virtual] |
Opens the RFile for which the aFilepath is passed in read mode.
TInt | OpenFileStoreForRead | ( | TMsvId | aEntryId, |
RFile & | aFile | |||
) | [virtual] |
Allows the message store classes to read the store file for a particular message entry.
Opens a message store file associated with the message entry specified by the aEntryId parameter. This method returns an open read-only file handle to the message store file.
void | OpenTempStoreFileL | ( | TMsvId | aEntryId, |
RFile & | aFile | |||
) | [virtual] |
Opens a temporary store file associated with the message entry specified by the aEntryId parameter. This method returns an open read-write file handle with an exclusive share to the temporary store file. The temporary store file is defined as <store_filename>.new. Data can be streamed to the temporary store file. It is expected that once the temporary store file has been written to and then closed, a call to ReplaceFileStoreL is required to replace the old store file with this temporary one.
Along with ReplaceFileStoreL, this method allows the message store classes to write data to the store file for a particular message entry.
TInt | RenameAttachment | ( | TMsvId | aEntryId, |
const TDesC & | aOldFilePath, | |||
const TDesC & | aNewName | |||
) | [virtual] |
Renames an existing attachment file.
Renames an existing attachment file in the message store associated with the message entry specified by the aEntryId parameter. The attachment is identified by the file path specified by the aOldFilePath parameter and renamed to the name supplied in the aNewName paramter.
void | ReplaceAttachmentForWriteL | ( | TMsvId | aEntryId, |
TDes & | aFilename, | |||
RFile & | aFile | |||
) | [virtual] |
Allows clients to replace an existing attachment file and allows clients to stream data to it.
Replaces an existing attachment file in the message store for the message entry specified by the aEntryId parameter. The attachment filename is set to the filename indicated by the aFilename parameter. If an attachment with the supplied name does not exist, a new file is created. The empty attachment file is passed back to the client using an opened file handle to the file in the message store.
TMsvId aEntryId | The entry for which an attachment needs to be created in the message store |
TDes & aFilename | The name of the attachment file to be created |
RFile & aFile | On return, The created file handle for the attachment file.The ownership is transferred . The caller must close the file handle. |
void | ReplaceFileStoreL | ( | TMsvId | aEntryId | ) | [virtual] |
Replaces the current store file with the temporary store file, created from OpenTempStoreFileL, for the message entry as specified by the aEntryId parameter. The method replaces the store file with the temporary file (<store_filename.new>) and if successful, will then delete the temporary store file. This method assumes that the temporary file exists, otherwise a KErrNotFound error occurs.
Along with OpenTempStoreFileL, this method allows the message store classes to write data to the store file for a particular message entry.
TMsvId aEntryId | The entry whose store needs to be replaced/overwritten |
void | ReplacePlainTextFileL | ( | TMsvId | aBodyTextId | ) | [virtual] |
TMsvId aBodyTextId | The Id of the bodytext. |
void | SetMsvServerAndFileSession | ( | CMsvServer & | aMsvServer, |
RFs & | aFs | |||
) |
CMsvServer & aMsvServer | |
RFs & aFs |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.