How to use FileAccessService in SmartCard

Hi all,i am dhaya, i ve problem with using FileAccessService.If i try to use this interface i am getting FileAccessService is not instantiable.i want 2 read a card file by using this FileAccessService.pls help me friends.regards,dhayas.
[285 byte] By [dhayasinfo@yahoo.co.ina] at [2007-10-2 4:35:51]
# 1

> i am dhaya, i ve problem with using

> FileAccessService.

> If i try to use this interface i am getting

> FileAccessService is not instantiable.

You can not create instances of an Interface, only of classes. You should try instanciating a class that implements this interface.

AFAIR there is only one class in the OCF that implements opencard.opt.iso.fs.FileAccessService:

com.ibm.opencard.isofs.MFCFileSystem.

Jan

JPJavaa at 2007-7-16 0:08:25 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

hi friend,

thanks for reply.

I got the access of card file now.

Now i have another pblm, that i when i am using MFCFileAccess.getRoot() , it returns :3f00. When i try to assign this value into CardFilePath object it returns a NullPointerException.

My code is here,

MFCFileSystem fileSys = new MFCFileSystem();

MFCFileAccess fileAccess = new MFCFileAccess();

//System.out.println("File Root = " + fileAccess.exists(rootPath));

System.out.println("File Root = " + fileAccess.getRoot());

CardFilePath rootPath = (CardFilePath)fileAccess.getRoot();

MFCFileInfo fileInfo = fileAccess.selectFile(rootPath);

System.out.println("File Size = " + fileInfo.getLength());

System.out.println("File Header = " + fileInfo.getHeader());

when i run this code i am getting,

Got terminal: OMNIKEY AG Smart Card Reader USB 0

Herererere

File Root = :3f00

java.lang.NullPointerException

at opencard.core.service.CardService.assertSchedulerStillAlive(CardService.java:379)

at opencard.core.service.CardService.allocateCardChannel(CardService.java:321)

at com.ibm.opencard.service.MFCCardService.allocateCardChannel(MFCCardService.java:357)

at com.ibm.opencard.isofs.MFCFileAccess.selectFile(MFCFileAccess.java:174)

at readerDemo.ReadFile.main(ReadFile.java:58)

BUILD SUCCESSFUL (total time: 1 second)

pls help me friends.

regards,

dhaya.

dhayasinfo@yahoo.co.ina at 2007-7-16 0:08:25 > top of Java-index,Java Mobility Forums,Consumer and Commerce...