forked from geodmms/xdgnjobs

?? ?
2008-05-06 0ffea4eece9090db61ff0042ac26a6cb2a356cab
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
@@ -42,6 +42,8 @@
    static Log logger = LogFactory.getLog(OracleConvertJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
    private static final String SHPOUTPATH = "shpout";
    static
    {
        try
@@ -62,6 +64,8 @@
    private PessimisticMapWrapper txFeaturesContext;
    private JobExecutionContext executionContext;
    private String dataOut = null;
    public OracleConvertJobContext(String filterConfig)
    {
@@ -116,7 +120,7 @@
    public void putFeatureCollection(Element element)
    {
        //§PÂ_¬O§_²Å©M±ø¥ó
        // §PÂ_¬O§_²Å©M±ø¥ó
        Feature feature = elementDispatcher.execute(element);
        if (feature == null)
        {
@@ -170,15 +174,14 @@
    private void updateDataStore()
    {
        // todo:
        Iterator it = featuresContext.keySet().iterator();
        Iterator it = featuresContext.keySet().iterator();
        try
        {
            while (it.hasNext())
            {
                FeatureType featureType = (FeatureType) it.next();
                File sfile = new File(_dataPath + "\\" + featureType.getTypeName());
                File sfile = new File(getDataOutPath() + "\\" + featureType.getTypeName());
                logger.debug("Begin Save shapefile:" + sfile.toURI());
                FeatureWriter writer = null;
@@ -232,6 +235,10 @@
        executionContext = context;
    }
    /**
     * Ãö³¬³]³Æ¼g¤J¾¹
     * @throws IOException IOµo¥Í¿ù»~
     */
    public void closeFeatureWrite() throws IOException {
       Iterator iter =   this.featuresWriterContext.values().iterator();
@@ -243,4 +250,25 @@
        this.featuresWriterContext = null;
    }
    /**
     * ¨ú±o¸ê®Æ¿é¥X¸ô®|
     * @return ¸ô®|ªº¦r¦ê
     */
    public String getDataOutPath()
    {
        if (dataOut == null)
        {
            File outPath = new File(getDataPath(), SHPOUTPATH);
            if (!outPath.exists())
            {
                outPath.mkdir();
            } else if (!outPath.isDirectory())
            {
                outPath.mkdir();
            }
            dataOut = getDataPath() + SHPOUTPATH;
        }
        return dataOut;
    }
}