try {
File file = fileChooser.getSelectedFile();
String path = file.getCanonicalPath();
EsriGraphicList list = layer.getEsriGraphicList();
ShpOutputStream pos = new ShpOutputStream(new FileOutputStream(path
+ ".shp"));
int[][] indexData = pos.writeGeometry(list);
ShxOutputStream xos = new ShxOutputStream(new FileOutputStream(path
+ ".shx"));
xos.writeIndex(indexData,
list.getType(),