sdkcreationmw/sdkruntimes/GuiLauncher/src/EcmtWlanOddSettingView.cpp
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description:  this file is used for wlan ODD appliction
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
#include <EcmtGui.rsg>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
#include "EcmtWlanOddSettingView.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
#include "EcmtWlanOddSettingList.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
#include "EcmtGui.hrh"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
#include "EcmtGuiAppUi.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#include <aknnotewrappers.h> 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
#include <ES_SOCK.H>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
#include <BAUTILS.H>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
#include <aknmessagequerydialog.h> //for ip address message query
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
CWlanOddSettingView* CWlanOddSettingView::NewL()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
    CWlanOddSettingView* self = new (ELeave) CWlanOddSettingView;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
    CleanupStack::PushL(self);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
    self->ConstructL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
    CleanupStack::Pop(self);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
    return self;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
CWlanOddSettingView::CWlanOddSettingView()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
CWlanOddSettingView::~CWlanOddSettingView()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
	if ( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
        AppUi()->RemoveFromStack( iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
        delete iContainer;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
        }     
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
TUid CWlanOddSettingView::Id() const 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
    { 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
    return TUid::Uid( EListboxSettingView ); 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
void CWlanOddSettingView::HandleCommandL( TInt aCommand )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
    switch( aCommand )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
        case EListboxCmdChange:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
            iContainer->EditItemL( 0, ETrue );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
        case EIp:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
            {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
            TBuf<20> ipAdds;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
            TRAPD(err,IPv4L(ipAdds));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
            if(KErrNone == err)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
                {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
                HBufC* buf;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
                buf = ipAdds.AllocL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
                CleanupStack::PushL(buf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
                CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(*buf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
                dlg->PrepareLC(R_IP_ADDRESS_DIALOG);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
                dlg->RunLD();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
                CleanupStack::PopAndDestroy(buf);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
                }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
             }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
             break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
        case EDeleteJavaDir:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
            {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
            User::InfoPrint(_L("deleting java dir"));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
            DelteJavaDirL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
            }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
        case EAknSoftkeyBack:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
            AppUi()->ActivateLocalViewL( TUid::Uid( EEcmtLogViewId ) );               
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
        default:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
            AppUi()->HandleCommandL(aCommand);  
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
        }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
void CWlanOddSettingView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
                      TUid /*aCustomMessageId*/,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
                      const TDesC8& /*aCustomMessage*/ )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
    {    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
    iContainer = CWlanSettingList::NewL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
    iContainer->SetMopParent( this );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
    iContainer->ConstructFromResourceL( R_LISTBOX_SETTING_ITEM_LIST );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
    AppUi()->AddToStackL( *this, iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
    iContainer->MakeVisible( ETrue );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
    iContainer->SetRect( ClientRect() );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
    iContainer->ActivateL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
void CWlanOddSettingView::DoDeactivate()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
    if ( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
        AppUi()->RemoveFromViewStack( *this, iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
        delete iContainer;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
        iContainer = NULL;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
        }    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
void CWlanOddSettingView::ConstructL()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
    BaseConstructL(R_LISTBOX_SETTINGS_VIEW);    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
void CWlanOddSettingView::DynInitMenuPaneL( TInt aResourceId, 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
                                           CEikMenuPane* aMenuPane )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
    }   
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
void CWlanOddSettingView::HandleSizeChange( TInt aType )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
    if( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
        iContainer->HandleResourceChange( aType );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
        
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
        if( aType==KEikDynamicLayoutVariantSwitch )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
            {        
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
            TRect rect;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
            iContainer->SetRect(rect);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
            }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
        }         
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
    } 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
//this function is used to get the ip address of the device
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
void CWlanOddSettingView::IPv4L(TDes& aIpAdds)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   151
    TBuf<20> deviPAdds;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   152
    RSocketServ socketServ;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   153
    TInetAddr inetAddr;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   154
    RSocket sock;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   155
    User::LeaveIfError(socketServ.Connect());
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   156
    User::LeaveIfError(sock.Open(socketServ, KAfInet, KSockStream, KProtocolInetTcp));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   157
    //Get IP information from the socket
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   158
    TSoInetInterfaceInfo ifInfo;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   159
    TPckg<TSoInetInterfaceInfo> ifInfoPkg(ifInfo);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   160
    TSoInetIfQuery ifQuery;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   161
    TPckg<TSoInetIfQuery> ifQueryPkg(ifQuery);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   162
    User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   163
    while(sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifInfoPkg) == KErrNone)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   164
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   165
        ifQuery.iName = ifInfo.iName;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   166
        TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, ifQueryPkg);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   167
        if( err == KErrNone )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   168
            {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   169
              if (!ifInfo.iAddress.IsUnspecified() && !ifInfo.iAddress.IsLoopback() && !ifInfo.iAddress.IsLinkLocal())
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   170
              {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   171
              inetAddr = ifInfo.iAddress;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   172
              inetAddr.ConvertToV4();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   173
              inetAddr.Output(deviPAdds);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   174
              aIpAdds.Copy(deviPAdds);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   175
              }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   176
            }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   177
         else if( err !=KErrNone )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   178
             {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   179
             sock.Close();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   180
             socketServ.Close();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   181
             }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   182
        } // while
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   183
        sock.Close();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   184
        socketServ.Close();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   185
   }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   186
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   187
void CWlanOddSettingView::DelteJavaDirL()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   188
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   189
    //path of java dir needs to be created for wlan odd
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   190
    _LIT(KWlanJavaDir,"c:\\java\\");
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   191
    RFs fs;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   192
    User::LeaveIfError(fs.Connect());
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   193
    CleanupClosePushL (fs);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   194
    CFileMan* image = CFileMan::NewL (fs);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   195
    CleanupStack::PushL (image);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   196
    TBool folderExist = EFalse; 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   197
    //check the path exists or not
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   198
    folderExist = BaflUtils::FolderExists (fs, KWlanJavaDir);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   199
    //if exists then remove the directory and create new
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   200
    if(folderExist)
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   201
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   202
        User::LeaveIfError(image->RmDir (KWlanJavaDir));
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   203
        }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   204
    CleanupStack::PopAndDestroy(2);//image or CFileMan object and fs    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   205
    }