forked from geodmms/xdgnjobs

?? ?
2008-09-03 b6a392076f6cae23014baebd1945f9496cd48e1a
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java
@@ -54,6 +54,7 @@
    private boolean useElementCount = true;
    private ArrayList<byte[]> dgnFileHeader = null;
    private String elmOutPath;
    private String prefix = null;
    public OracleElementLogger(Connection connection)
    {
@@ -67,6 +68,20 @@
        this.elmOutPath = elmOutPath;
    }
    public OracleElementLogger(Connection connection, int maxCount)
    {
        this.connection = connection;
        elmOutPath = DEFAULT_ELMOUTPATH;
        this.maxElmCount = maxCount;
    }
    public OracleElementLogger(Connection connection, String elmOutPath, int maxCount)
    {
        this.connection = connection;
        this.elmOutPath = elmOutPath;
        this.maxElmCount = maxCount;
    }
    public String getDataOutPath()
    {
        if (dataOut == null)
@@ -284,11 +299,21 @@
            fch = null;
        }
        File logFile = new File(getDataOutPath(), this.currentSchema + ".dgn");
        String outLogName = currentSchema + ".dgn";
        if (prefix != null)
        {
            outLogName = prefix + outLogName;
        }
        File logFile = new File(getDataOutPath(), outLogName);
        while (logFile.exists())
        {
            logFile = new File(getDataOutPath(), this.currentSchema + "-"
                    + (++logCount) + ".dgn");
            outLogName = this.currentSchema + "-" + (++logCount) + ".dgn";
            if (prefix != null)
            {
                outLogName = prefix + outLogName;
            }
            logFile = new File(getDataOutPath(), outLogName);
        }
        logger.warn("Create Dgn Logging File:" + logFile.toString());
@@ -453,4 +478,14 @@
    {
        this.maxElmCount = maxElmCount;
    }
    public String getLogPrefix()
    {
        return prefix;
    }
    public void setLogPrefix(String prefix)
    {
        this.prefix = prefix;
    }
}