> 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
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.