Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## opencard.opt.iso.fs
Interface CardFileInfo

All Known Implementing Classes:
  CardFile

public abstract interface CardFileInfo

Provides information about the structure of a file. File information is obtained from the smartcard by selecting a file. The file may be a dedicated file (DF, also referred to as directory) or an elementary file (EF). The smartcard typically responds with the selected file's header.
Unlike the select command itself, the file header is not subject to standards, so it cannot be encapsulated in a predefined class. This interface defines some methods that should be implementable regardless of the particular card and it's select response. Most of these methods provide information about the structure of an elementary file.
The comments to the methods required by this interface assume knowledge of the file types defined by ISO 7816. Some information about these file types can be found in the comments to `FileAccessCardService`. The term the file, which is frequently used in the comments, refers to the file on the smartcard for which an instance of this interface provides information.

See Also:
  `FileAccessCardService`

Method Summary
`short` | `getFileID()` Returns the identifier of the file.
`byte[]` | `getHeader()` Returns the file header.
`int` | `getLength()` Returns the length of the file.
`int` | `getRecordSize()` Returns the record size of the file.
`boolean` | `isCyclic()` Tests whether the file is a cyclic file.
`boolean` | `isDirectory()` Tests whether the file is a DF.
`boolean` | `isTransparent()` Tests whether the file is a transparent file.
`boolean` | `isVariable()` Tests whether the file is a variable record file.

Method Detail

### getFileID

    public short getFileID()

  Returns the identifier of the file. It is most likely that this method is of no particular use, but since the file identifier is the most basic information about a file at all, it is included here anyway.
  Returns:
    the identifier of the file

### isDirectory

    public boolean isDirectory()

  Tests whether the file is a DF.
  Returns:
    `true` if the file is a DF, `false` otherwise

### isTransparent

    public boolean isTransparent()

  Tests whether the file is a transparent file. The value returned is valid only if the file is not a DF, that is if `isDirectory` returns `false`.
  Returns:
    `true` if the file is a transparent file
  See Also:
    `isDirectory()`

### isCyclic

    public boolean isCyclic()

  Tests whether the file is a cyclic file. The value returned is valid only if the file is not a DF and not a transparent file, that is if `isDirectory` as well as `isTransparent` return `false`.
  Returns:
    `true` if the file is a cyclic file
  See Also:
    `isDirectory()`, `isTransparent()`

### isVariable

    public boolean isVariable()

  Tests whether the file is a variable record file. The value returned is valid only if the file is not a DF and not a transparent file, that is if `isDirectory` as well as `isTransparent` return `false`.
  Returns:
    `true` if the file is a structured file with variable record size
  See Also:
    `isDirectory()`, `isTransparent()`

### getLength

    public int getLength()

  Returns the length of the file. If the file is a transparent file, that is if `isDirectory` returns `false` and `isTransparent` returns `true`, this method returns the number of bytes in the file.
  If the file is a structured file with fixed record length, either cyclic or non-cyclic, this method returns also returns the number of bytes in the file, that is the size of a record multiplied by the number of bytes in a record.
  If the file is a DF, a structured file with variable record length, or some card specific file type, the value returned by this method is implementation dependent.
  Returns:
    the number of bytes in the file
  See Also:
    `isDirectory()`, `isTransparent()`

### getRecordSize

    public int getRecordSize()

  Returns the record size of the file. The value returned is valid only if the file is a structured file with fixed record size, that is if `isDirectory`, `isTransparent` and `isVariable` return `false`.
  Returns:
    the size of a record of the file
  See Also:
    `isDirectory()`, `isTransparent()`, `isVariable()`

### getHeader

    public byte[] getHeader()

  Returns the file header. This method actually returns the smartcard's response (or expected response) to a selection of the file. For an EF, this is the file header which may have been expanded by some application data, if the card OS allows to do so. For a DF, this is the file header, also optionally expanded, or some other data that has been defined as the select response for the DF. The EMV standard requires the select response for a DF to be defineable by applications.
  This method is not invoked by the OpenCard Framework, and it is not yet clear whether it will be useful for applications. However, removing a method from this interface will be easier than adding it later, so it is currently required. File services that do not want to support this method may simply return `null`.
  Returns:
    the smartcard's response to a selection of the file, or `null` if not supported

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD