Changeset 15323


Ignore:
Timestamp:
2008-05-01T13:35:09+12:00 (16 years ago)
Author:
kjdon
Message:

added support for JDBM (or other) in place of GDBM: changed the possible options for database file name, and changed the method name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/util/GSFile.java

    r15026 r15323  
    289289    }
    290290
    291     /** the gdbm database file -
    292      * note, need to change extension depending on OS */
     291    /** the collection database file -
     292     * note, need to change extension depending on OS and database type */
    293293    // The perl code can't detect big vs little endian on a Mac, so the Perl
    294294    // code will always name the gdbm db file .bdb on a Mac whether its little
    295295    // endian or not. A Mac little endian file is NOT the same as a Linux
    296296    // little endian file
    297     static public String GDBMDatabaseFile(String site_home,
    298                       String collection_name,
    299                       String index_stem) {
    300 
    301     String db_ext = ".ldb";
    302     if (Misc.isMac() || Misc.isBigEndian()) {
     297  // jdbm files are endian independent ??
     298    static public String collectionDatabaseFile(String site_home,
     299                        String collection_name,
     300                        String index_stem,
     301                        String database_type) {
     302
     303        String db_ext = null;
     304    if (database_type.equalsIgnoreCase("jdbm")) {
     305      db_ext = ".db";
     306    } else {
     307      // assume gdbm
     308      db_ext = ".ldb";
     309      if (Misc.isMac() || Misc.isBigEndian()) {
    303310        db_ext = ".bdb";
    304     }
     311      }
     312    }
     313   
    305314    return site_home + File.separatorChar +
    306315        "collect" + File.separatorChar +
Note: See TracChangeset for help on using the changeset viewer.