public void createCSVFile(String outpuCSVFilePath, SimpleFeatureSource featureSource) throws IOException {

		SimpleFeatureCollection collection = featureSource.getFeatures();
		SimpleFeatureIterator iterator = collection.features();

		FileWriter writer = new FileWriter(outpuCSVFilePath);

		for (int i= 0; i < featureSource.getSchema().getAttributeCount(); i++) {
			if (featureSource.getSchema().getGeometryDescriptor().getType().getName() != featureSource.getSchema().getType(i).getName()){
				writer.append(featureSource.getSchema().getType(i).getName().getLocalPart());
				writer.append(';');
			}
		}

		writer.append(featureSource.getSchema().getGeometryDescriptor().getType().getName().getLocalPart());
		writer.append('\n');

		while (iterator.hasNext()) {

			SimpleFeature feature = (SimpleFeature) iterator.next();

			Geometry geometry = (Geometry) feature.getDefaultGeometry();
			ShapeType type = JTSUtilities.findBestGeometryType(geometry);
			if(!type.isPolygonType() && !type.isLineType() && 
					!type.isPointType()) {
				//log.warnLog("warning message here");
				//warningCount++;
				break;
			}

			if(geometry.isEmpty()) {
				// TODO empty geometry
				continue;
			}

			List<Object> featureAttributes = feature.getAttributes();

			Iterator<Object> itr = featureAttributes.iterator(); 
			while(itr.hasNext()) {
				Object element = itr.next(); 
				if (element != feature.getDefaultGeometry()) {
					writer.append(element.toString());
					writer.append(';');
				}
			}

			writer.append(feature.getDefaultGeometry().toString());
			writer.append('\n');

		}
		writer.flush();
		writer.close();
	}