49
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Header file for JavaVersionBackupUtil class
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef JAVAVERSIONBACKUPUTIL_H
|
|
20 |
#define JAVAVERSIONBACKUPUTIL_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <driveinfo.h>
|
|
24 |
#include <javaenvinfo.h>
|
|
25 |
|
|
26 |
class RDesReadStream;
|
|
27 |
class RDesWriteStream;
|
|
28 |
|
|
29 |
namespace java
|
|
30 |
{
|
|
31 |
namespace backup
|
|
32 |
{
|
|
33 |
/**
|
|
34 |
* JavaVersionBackupUtil class is used for checking the java version
|
|
35 |
* during a B&R operation. This class writes the current java version
|
|
36 |
* while backing up and then checks whether the backed up version
|
|
37 |
* is compatible with the currnet version while doing a restore.
|
|
38 |
* If it is not compatible, then the backup process is gracefully exited.
|
|
39 |
*/
|
|
40 |
|
|
41 |
class JavaVersionBackupUtil
|
|
42 |
{
|
|
43 |
|
|
44 |
public:
|
|
45 |
|
|
46 |
/**
|
|
47 |
* This method writes the current java version into the SBE buffer.
|
|
48 |
* This functions is called when a backup process is started.
|
|
49 |
*
|
|
50 |
* @param aBuffer the buffer which is sent by the SBE
|
|
51 |
*/
|
|
52 |
static void WriteJavaVersionL(RDesWriteStream& aStream);
|
|
53 |
|
|
54 |
/**
|
|
55 |
* This method reads the java version from the stream. If there is no
|
|
56 |
* Java version or if the Java version is not compatible with the
|
|
57 |
* current version, then the restore process is exited gracefully.
|
|
58 |
*
|
|
59 |
* @param aStream an RDesReadStream on the buffer which is sent
|
|
60 |
* by the SBE
|
|
61 |
* @param aDrive current drive to be backed up
|
|
62 |
* @return status
|
|
63 |
*/
|
|
64 |
static TUint CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck);
|
|
65 |
|
|
66 |
private:
|
|
67 |
|
|
68 |
/**
|
|
69 |
* This method is used to compare the current java version with the
|
|
70 |
* one read from the stream.
|
|
71 |
* This method is not used presently. Logic may be added in the future
|
|
72 |
*
|
|
73 |
* @param aVersion the java version read from the stream
|
|
74 |
* @param aCurVersion the current java version
|
|
75 |
*/
|
|
76 |
void CompareL(TVersion aVersion, TVersion aCurVersion);
|
|
77 |
|
|
78 |
};
|
|
79 |
|
|
80 |
} // namespace backup
|
|
81 |
} // namespace java
|
|
82 |
|
|
83 |
#endif // JAVAVERSIONBACKUPUTIL_H
|