OpenCard  
 
OCF, the OpenCard Framework is a standard Java framework for working with Smart Cards.  
 

com.ibm.opencard.isofs
Class MFCFileInfo

java.lang.Object
  |
  +--com.ibm.opencard.service.MFCCardObjectInfo
        |
        +--com.ibm.opencard.isofs.MFCFileInfo

public class MFCFileInfo
extends MFCCardObjectInfo
implements CardFileInfo

Information about a smartcard file or directory. This class should be renamed to and replace MFCCardFileInfo. Currently, this is not done to avoid confusion with two different classes sharing a single name.

Version:
$Id: MFCFileInfo.java,v 1.1 1999/12/02 16:06:04 damke Exp $

Constructor Summary
MFCFileInfo()
          Instantiates new file information.
 
Method Summary
 short getFileID()
          Returns the identifier of the file.
 byte[] getHeader()
          Returns the header of this file.
 int getLength()
          Returns the length of this file.
 int getRecordSize()
          Returns the record size of this file.
 boolean isCyclic()
          Tests whether this file is cyclic.
 boolean isDirectory()
          Tests whether the file is a DF.
 boolean isTransparent()
          Tests whether this file is transparent.
 boolean isVariable()
          Tests whether this file has a variable record size.
 void setCyclic(boolean isCyclic)
          Specifies whether the file on which to keep information is cyclic.
 void setFileID(short fileID)
          Sets the ID of the file on which to keep information.
 void setFileSize(int fileSize)
          Specifies the size of the file on which to keep information.
 void setHeader(byte[] header)
          Sets the file header.
 void setRecordSize(int recordSize)
          Specifies the record size of the file on which to keep information.
 void setTransparent(boolean isTransparent)
          Specifies whether the file on which to keep information is transparent.
protected  void toStringHook(java.lang.StringBuffer sb)
          Add information to the base class toString() method.
 
Methods inherited from class com.ibm.opencard.service.MFCCardObjectInfo
getAccessConditions, getAccessInfo, isContainer, setAccessInfo, setContainer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MFCFileInfo

public MFCFileInfo()
Instantiates new file information. The information is not yet set up after creation. It has to be set explicitly afterwards.
Method Detail

setHeader

public final void setHeader(byte[] header)
Sets the file header. Upon selection of a file, the smartcard will respond with a file header and, optionally, some additional information. This method is used to store the smartcard's response in the info structure.
Parameters:
header - the header of the file

setFileID

public final void setFileID(short fileID)
Sets the ID of the file on which to keep information. Every file on a smartcard has a 2 byte identifier that is unique within the respective directory.
Parameters:
fileID - the identifier of the file

setTransparent

public final void setTransparent(boolean isTransparent)
Specifies whether the file on which to keep information is transparent. Files that are not transparent are either structured or dedicated files. To distinguish these, a base class attribute indicates whether the file is a container, and therefore a dedicated file.
Parameters:
isTransparent - true if the file is transparent, false otherwise
See Also:
MFCCardObjectInfo.isContainer()

setCyclic

public final void setCyclic(boolean isCyclic)
Specifies whether the file on which to keep information is cyclic. This attribute is relevant only if the file is neither transparent nor a dedicated file. In this case it has to be a structured file. If the structure is cyclic, fixed size, this method must be used to specify that.
Parameters:
isCyclic - true if the file has a cyclic structure, false otherwise. If this method is not invoked at all, the value defaults to false.

setFileSize

public final void setFileSize(int fileSize)
Specifies the size of the file on which to keep information. Any file, whether it's transparent, structured, or a dedicated file, has an associated file size. The file size can be specified by invoking this method.
Parameters:
fileSize - the number of bytes of the file contents

setRecordSize

public final void setRecordSize(int recordSize)
Specifies the record size of the file on which to keep information. This attribute is relevant only for files with a fixed record length. For a file with variable record sizes, 0 must be specified. For files that are not structured, this method should not be invoked at all.
Parameters:
recordSize - the number of bytes in a record

getFileID

public final short getFileID()
Returns the identifier of the file.
Specified by:
getFileID in interface CardFileInfo
Returns:
the 2 byte identifier of the file
See Also:
CardFileInfo.getFileID()

isDirectory

public final boolean isDirectory()
Tests whether the file is a DF.
Specified by:
isDirectory in interface CardFileInfo
Returns:
true iff this file is a directory
See Also:
CardFileInfo.isDirectory()

isTransparent

public final boolean isTransparent()
Tests whether this file is transparent.
Specified by:
isTransparent in interface CardFileInfo
Returns:
true iff this file is transparent
See Also:
CardFileInfo.isTransparent()

isCyclic

public final boolean isCyclic()
Tests whether this file is cyclic.
Specified by:
isCyclic in interface CardFileInfo
Returns:
true iff this file is cyclic.
See Also:
CardFileInfo.isCyclic()

isVariable

public final boolean isVariable()
Tests whether this file has a variable record size.
Specified by:
isVariable in interface CardFileInfo
Returns:
true iff this file is variable.
See Also:
CardFileInfo.isVariable()

getLength

public final int getLength()
Returns the length of this file.
Specified by:
getLength in interface CardFileInfo
Returns:
the number of bytes in this file
See Also:
CardFileInfo.getLength()

getRecordSize

public final int getRecordSize()
Returns the record size of this file.
Specified by:
getRecordSize in interface CardFileInfo
Returns:
the number of bytes in a record of this file
See Also:
CardFileInfo.getRecordSize()

getHeader

public final byte[] getHeader()
Returns the header of this file.
Specified by:
getHeader in interface CardFileInfo
Returns:
the header as a byte array
See Also:
CardFileInfo.getHeader()

toStringHook

protected void toStringHook(java.lang.StringBuffer sb)
Add information to the base class toString() method.
Overrides:
toStringHook in class MFCCardObjectInfo