当前位置: 首页>>代码示例>>Java>>正文


Java FileUtil.getDefaultInstance方法代码示例

本文整理汇总了Java中org.hsqldb.lib.FileUtil.getDefaultInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.getDefaultInstance方法的具体用法?Java FileUtil.getDefaultInstance怎么用?Java FileUtil.getDefaultInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.lib.FileUtil的用法示例。


在下文中一共展示了FileUtil.getDefaultInstance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openFile

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
/**
 *  File is opened in append mode although in current usage the file
 *  never pre-exists
 */
protected void openFile() {

    try {
        FileAccess   fa  = isDump ? FileUtil.getDefaultInstance()
                                  : database.getFileAccess();
        OutputStream fos = fa.openOutputStreamElement(outFile);

        outDescriptor = fa.getFileSync(fos);
        fileStreamOut = new BufferedOutputStream(fos, 2 << 12);
    } catch (IOException e) {
        throw Error.error(ErrorCode.FILE_IO_ERROR,
                          ErrorCode.M_Message_Pair, new Object[] {
            e.toString(), outFile
        });
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:ScriptWriterBase.java

示例2: openFile

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
/**
 *  File is opened in append mode although in current usage the file
 *  never pre-exists
 */
protected void openFile() throws HsqlException {

    try {
        FileAccess   fa  = isDump ? FileUtil.getDefaultInstance()
                                  : database.getFileAccess();
        OutputStream fos = fa.openOutputStreamElement(outFile);

        outDescriptor = fa.getFileSync(fos);
        fileStreamOut = new BufferedOutputStream(fos, 2 << 12);
    } catch (IOException e) {
        throw Trace.error(Trace.FILE_IO_ERROR, Trace.Message_Pair,
                          new Object[] {
            e.toString(), outFile
        });
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:ScriptWriterBase.java

示例3: deleteDatabase

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
static void deleteDatabase(String path) {

        FileUtil fileUtil = FileUtil.getDefaultInstance();

        fileUtil.delete(path + ".backup");
        fileUtil.delete(path + ".properties");
        fileUtil.delete(path + ".script");
        fileUtil.delete(path + ".data");
        fileUtil.delete(path + ".log");
        fileUtil.delete(path + ".lck");
        fileUtil.delete(path + ".csv");
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:TestCacheSize.java

示例4: HsqlProperties

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
public HsqlProperties(String fileName) {

        stringProps   = new Properties();
        this.fileName = fileName;
        fa            = FileUtil.getDefaultInstance();
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:7,代码来源:HsqlProperties.java

示例5: initParams

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
/**
 * Initial external parameters are set here. The size if fixed.
 */
protected void initParams(Database database, String baseFileName) {

    fileName      = baseFileName + ".data.tmp";
    this.database = database;
    fa            = FileUtil.getDefaultInstance();

    int cacheSizeScale = 10;

    cacheFileScale = 8;

    Error.printSystemOut("cache_size_scale: " + cacheSizeScale);

    maxCacheSize = 2048;

    int avgRowBytes = 1 << cacheSizeScale;

    maxCacheBytes   = maxCacheSize * avgRowBytes;
    maxDataFileSize = (long) Integer.MAX_VALUE * 4;
    dataFile        = null;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:24,代码来源:DataFileCacheSession.java

示例6: initParams

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
protected void initParams(Database database, String baseFileName) {

        fileName      = baseFileName;
        this.database = database;
        fa            = FileUtil.getDefaultInstance();

        HsqlProperties tableprops =
            HsqlProperties.delimitedArgPairsToProps(fileName, "=", ";", null);

        // source file name is the only key without a value
        fileName = tableprops.errorKeys[0].trim();

        //-- Get separators:
        HsqlDatabaseProperties dbProps = database.getProperties();

        fs = translateSep(tableprops.getProperty("fs",
                dbProps.getProperty(HsqlDatabaseProperties.textdb_fs, ",")));
        vs = translateSep(tableprops.getProperty("vs",
                dbProps.getProperty(HsqlDatabaseProperties.textdb_vs, fs)));
        lvs = translateSep(tableprops.getProperty("lvs",
                dbProps.getProperty(HsqlDatabaseProperties.textdb_lvs, fs)));

        //-- Get booleans
        ignoreFirst = tableprops.isPropertyTrue(
            "ignore_first",
            dbProps.isPropertyTrue(
                HsqlDatabaseProperties.textdb_ignore_first, false));
        isQuoted = tableprops.isPropertyTrue(
            "quoted",
            dbProps.isPropertyTrue(
                HsqlDatabaseProperties.textdb_quoted, true));
        isAllQuoted = tableprops.isPropertyTrue(
            "all_quoted",
            dbProps.isPropertyTrue(
                HsqlDatabaseProperties.textdb_all_quoted, false));

        //-- Get encoding
        stringEncoding = translateSep(tableprops.getProperty("encoding",
                dbProps.getProperty(HsqlDatabaseProperties.textdb_encoding,
                                    "ASCII")));

        //-- Get size and scale
        int cacheScale = tableprops.getIntegerProperty(
            "cache_scale",
            dbProps.getIntegerProperty(
                HsqlDatabaseProperties.textdb_cache_scale, 10, 8, 16));
        int cacheSizeScale = tableprops.getIntegerProperty(
            "cache_size_scale",
            dbProps.getIntegerProperty(
                HsqlDatabaseProperties.textdb_cache_size_scale, 10, 8, 20));
        int lookupTableLength = 1 << cacheScale;
        int avgRowBytes       = 1 << cacheSizeScale;

        maxCacheSize     = lookupTableLength * 3;
        maxCacheBytes    = maxCacheSize * avgRowBytes;
        maxDataFileSize  = Integer.MAX_VALUE;
        cachedRowPadding = 1;
        cacheFileScale   = 1;
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:60,代码来源:TextCache.java

示例7: HsqlProperties

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
public HsqlProperties(String name) {

        stringProps = new Properties();
        fileName    = name;
        fa          = FileUtil.getDefaultInstance();
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:7,代码来源:HsqlProperties.java

示例8: initParams

import org.hsqldb.lib.FileUtil; //导入方法依赖的package包/类
protected void initParams(Database database,
                          String baseFileName) throws HsqlException {

    fileName      = baseFileName;
    this.database = database;
    fa            = FileUtil.getDefaultInstance();

    HsqlProperties tableprops =
        HsqlProperties.delimitedArgPairsToProps(fileName, "=", ";", null);

    //-- Get file name
    switch (tableprops.errorCodes.length) {

        case 0 :
            throw Trace.error(Trace.TEXT_TABLE_SOURCE,
                              Trace.TEXT_TABLE_SOURCE_FILENAME);
        case 1 :

            // source file name is the only key without a value
            fileName = tableprops.errorKeys[0].trim();
            break;

        default :
            throw Trace.error(Trace.TEXT_TABLE_SOURCE,
                              Trace.TEXT_TABLE_SOURCE_VALUE_MISSING,
                              tableprops.errorKeys[1]);
    }

    //-- Get separators:
    HsqlDatabaseProperties dbProps = database.getProperties();

    fs = translateSep(tableprops.getProperty("fs",
            dbProps.getProperty(HsqlDatabaseProperties.textdb_fs, ",")));
    vs = translateSep(tableprops.getProperty("vs",
            dbProps.getProperty(HsqlDatabaseProperties.textdb_vs, fs)));
    lvs = translateSep(tableprops.getProperty("lvs",
            dbProps.getProperty(HsqlDatabaseProperties.textdb_lvs, fs)));

    if (fs.length() == 0 || vs.length() == 0 || lvs.length() == 0) {
        throw Trace.error(Trace.TEXT_TABLE_SOURCE,
                          Trace.TEXT_TABLE_SOURCE_SEPARATOR);
    }

    //-- Get booleans
    ignoreFirst = tableprops.isPropertyTrue(
        "ignore_first",
        dbProps.isPropertyTrue(
            HsqlDatabaseProperties.textdb_ignore_first, false));
    isQuoted = tableprops.isPropertyTrue(
        "quoted",
        dbProps.isPropertyTrue(
            HsqlDatabaseProperties.textdb_quoted, true));
    isAllQuoted = tableprops.isPropertyTrue(
        "all_quoted",
        dbProps.isPropertyTrue(
            HsqlDatabaseProperties.textdb_all_quoted, false));

    //-- Get encoding
    stringEncoding = translateSep(tableprops.getProperty("encoding",
            dbProps.getProperty(HsqlDatabaseProperties.textdb_encoding,
                                "ASCII")));

    //-- Get size and scale
    int cacheScale = tableprops.getIntegerProperty(
        "cache_scale",
        dbProps.getIntegerProperty(
            HsqlDatabaseProperties.textdb_cache_scale, 10, 8, 16));
    int cacheSizeScale = tableprops.getIntegerProperty(
        "cache_size_scale",
        dbProps.getIntegerProperty(
            HsqlDatabaseProperties.textdb_cache_size_scale, 10, 8, 20));
    int lookupTableLength = 1 << cacheScale;
    int avgRowBytes       = 1 << cacheSizeScale;

    maxCacheSize     = lookupTableLength * 3;
    maxCacheBytes    = maxCacheSize * avgRowBytes;
    maxDataFileSize  = Integer.MAX_VALUE;
    cachedRowPadding = 1;
    cacheFileScale   = 1;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:81,代码来源:TextCache.java


注:本文中的org.hsqldb.lib.FileUtil.getDefaultInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。