Vector CSRs = new Vector();
String storeName = File.getStorageRoot(
Constants.INTERNAL_STORAGE_ID) + CSR_ID_FILE;
RandomAccessStream storage =
new RandomAccessStream(classSecurityToken);
DataInputStream dis;
try {
storage.connect(storeName, Connector.READ);
dis = new DataInputStream(storage.openInputStream());
} catch (IOException ioe) {
try {
storage.connect(storeName, Connector.READ_WRITE);
DataOutputStream dos = storage.openDataOutputStream();
dos.writeInt(0);
dos.flush();
dos.close();
dis = new DataInputStream(storage.openInputStream());
} catch (IOException openwe) {
return CSRs;
}
try {
storage.disconnect();
} catch (IOException e) {} // ignored
return CSRs;
}
try {
int count = dis.readInt();
while (count-- > 0) {
byte[] id = new byte[20];
dis.read(id, 0, 20);
CSRs.addElement(id);
}
} catch (IOException e) {} // ignored
finally {
try {
storage.disconnect();
} catch (IOException e) {} // ignored
}
return CSRs;
}