|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.opt.iso.fs.CardFilePath
public class CardFilePath
CardFilePath encapsulates the various ways of addressing files on a smart card:
CardFile
Field Summary | |
---|---|
static java.lang.String |
APPID_PREFIX
|
protected CardFilePathComponent[] |
components
CardFilePath array containing the path components. |
static java.lang.String |
FID_SEPARATOR
|
static java.lang.String |
PARTIALAPPID_POSTFIX
|
static java.lang.String |
ROOTFILEID
|
static java.lang.String |
SYM_SEPARATOR
There are two kinds of path component separators: SYM_SEPARATOR used for symbolic paths (for example "/wuff/oink") FID_SEPARATOR used for file ID paths (for example ":CAFF:EEBA:BE00") Although represented as a string, both separators really are just one character long. |
Constructor Summary | |
---|---|
CardFilePath(byte[] bites)
Instantiate a CardFilePath from an array of bytes. |
|
CardFilePath(CardFilePath path)
Clone the path object. |
|
CardFilePath(java.lang.String path)
Create a CardFilePath from a String. |
Method Summary | |
---|---|
CardFilePath |
append(CardFilePath path)
Append to this CardFilePath object. |
CardFilePath |
append(CardFilePathComponent comp)
Append to this CardFilePath object. |
CardFilePath |
chompPrefix(CardFilePath prefix)
Chomp of the prefix of this path. |
boolean |
chompTail()
Chomp off the last component of the path. |
int |
commonPrefixLength(CardFilePath path)
Return the length of the common CardFilePath prefix (if at all). |
java.util.Enumeration |
components()
Return an enumeration of the components of this CardFilePath. |
boolean |
equals(java.lang.Object filePath)
Check whether this CardFilePath is equal to another. |
CardFilePath |
greatestCommonPrefix(CardFilePath path)
Return the longest commmon prefix with another CardFilePath. |
int |
hashCode()
Overrides Object.hashCode() since we already provide equals(). |
int |
numberOfComponents()
Return the number components in this path. |
boolean |
startsWith(CardFilePath prefix)
Check whether this path starts with prefix. |
CardFilePathComponent |
tail()
Return the last CardFilePathComponent of this CardFilePath object. |
java.lang.String |
toString()
Return a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SYM_SEPARATOR
public static final java.lang.String FID_SEPARATOR
public static final java.lang.String APPID_PREFIX
public static final java.lang.String PARTIALAPPID_POSTFIX
public static final java.lang.String ROOTFILEID
protected CardFilePathComponent[] components
Constructor Detail |
---|
public CardFilePath(java.lang.String path) throws CardIOException
path
- The string representation of the path.
CardIOException
- Thrown either when the path has a silly format (e.g., file ID components
followed by an application ID) or when the path contains malformed
components (e.g., a short file ID containing just one nibble instead of a
full byte) or when the path is emptypublic CardFilePath(byte[] bites)
bites
- An array of bytes containing file IDs; the lowest pair
(bites[0] and bites[1]) form the first
path component; bites[0] is the high order byte
and bites[1] is the low order byte.public CardFilePath(CardFilePath path)
path
- The CardFilePath object to clone.Method Detail |
---|
public java.util.Enumeration components()
public CardFilePath append(CardFilePath path)
path
- The CardFilePath object to append.public CardFilePath append(CardFilePathComponent comp)
comp
- The CardFilePathComponent object to append.public boolean startsWith(CardFilePath prefix)
prefix
- The potentially common prefix.
public boolean equals(java.lang.Object filePath)
equals
in class java.lang.Object
filePath
- The path to compare with.
public int commonPrefixLength(CardFilePath path)
path
- The other CardFilePath to check against.
public CardFilePath greatestCommonPrefix(CardFilePath path)
path
- The other CardFilePath.
java.lang.IllegalArgumentException
- Thrown when both paths do not share a common prefix.public CardFilePath chompPrefix(CardFilePath prefix)
prefix
- The prefix to chomp off.
java.lang.IllegalArgumentException
- Thrown when the prefix is not.public boolean chompTail()
public CardFilePathComponent tail()
public int numberOfComponents()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |