From 0bd011e9dda3aabf6bbe3b9fad3f855a1ff2fae6 Mon Sep 17 00:00:00 2001
From: ?? ? <ulysseskao@ximple.com.tw>
Date: Mon, 26 May 2008 14:06:48 +0800
Subject: [PATCH] update for EOFM-106

---
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeneralDgnConvertJobContext.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeneralDgnConvertJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeneralDgnConvertJobContext.java
index 93e587c..7783243 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeneralDgnConvertJobContext.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeneralDgnConvertJobContext.java
@@ -165,10 +165,19 @@
                     ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(),
                             true, Charset.forName("UTF-8"));
                     */
-                    ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
-                            null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8"));
-                    shapefileDataStore.createSchema(featureType);
-                    writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT);
+                    if (!sfile.exists())
+                    {
+                        ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
+                                null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8"));
+                        shapefileDataStore.createSchema(featureType);
+                        writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(),
+                                Transaction.AUTO_COMMIT);
+                    } else {
+                        ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
+                                null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8"));
+                        writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(),
+                                Transaction.AUTO_COMMIT);
+                    }
                     featuresWriterContext.put(featureType.getTypeName(), writer);
                 }
 

--
Gitblit v0.0.0-SNAPSHOT