Changeset 37355


Ignore:
Timestamp:
2023-02-25T15:30:16+13:00 (3 weeks ago)
Author:
davidb
Message:

Addition to code: if the '-load' file specified is relative, then it prepends the collect_dir. A complication here is that collect_dir as a member field isn't set yet, and so we have to check ourselves if we are in the situation of a custom collect dir provided on the command-line, or else going to be usesing the default one

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r37341 r37355  
    401401                open_collection_file_path = Configuration.getString(
    402402                "general.open_collection"+Configuration.gliPropertyNameSuffix(), true);
     403            }
     404            else {
     405                // see if it is expressed as a relative filename, in which case, prepend
     406                // collect_directory_path
     407                File open_collection_file = new File(open_collection_file_path);
     408                if (!open_collection_file.isAbsolute()) {
     409                // dealing with a relative dir
     410                // => prefix collect_directory_path
     411                // but first need to work out this out for ourselves, as standard/non-standard collect_dir
     412                // has not yet been determined
     413               
     414                String resolved_collect_directory_path =
     415                    (collect_directory_path != null)
     416                    ? collect_directory_path : getDefaultGSCollectDirectoryPath(false);  // false => without dir sep at end
     417
     418                open_collection_file_path = resolved_collect_directory_path + File.separator + open_collection_file_path;
     419                }
     420   
    403421            }
    404422            // we haven't worked out site name yet, so do this step later ...
Note: See TracChangeset for help on using the changeset viewer.