Changeset 7468


Ignore:
Timestamp:
2004-05-27T14:12:54+12:00 (20 years ago)
Author:
cs025
Message:

Used URLTools to get File converted to URL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java

    r7311 r7468  
    4141import org.greenstone.gsdl3.util.GSXML;
    4242import org.greenstone.gsdl3.util.XMLConverter;
    43 
     43import org.greenstone.gsdl3.util.URLTools;
    4444
    4545/**
     
    6060  GS3SQLConnection   database;       // the database to store everything in
    6161  String             collectionHome;
    62     String           siteHome;
     62  String             siteHome;
    6363  String             collectionName;
    64     String           qualifiedCollectionName; // used as the database name
    65 
    66     BuildManager     buildManager;
     64  String             qualifiedCollectionName; // used as the database name
     65
     66  BuildManager       buildManager;
    6767   
    6868  class CollectionClassifier
     
    113113
    114114    public ClassifierInterface getClassifier()
    115     {
    116      ClassifierInterface classifier = null;
     115    { ClassifierInterface classifier = null;
    117116
    118117      if (this.type == null) {
     
    120119      }
    121120      System.out.println(this.type.toLowerCase());
     121     
    122122      if (this.type.toLowerCase().equals("hierarchy")) {
    123       classifier = new HierarchyClassifier(this.className, this.file, this.fields, this.sort);
     123    classifier = new HierarchyClassifier(this.className, this.file, this.fields, this.sort);
    124124      }
    125125      else if (this.type.toLowerCase().equals("azlist")) {
    126       classifier = new AZListClassifier(this.className, this.fields);
     126    classifier = new AZListClassifier(this.className, this.fields);
    127127      }
    128128
     
    137137   *  @param collection <code>String</code> the name of the collection
    138138   */
    139     public CollectionManager(String site, String collection) {
    140    
    141     String gsdl3Root = System.getProperty("GSDL3HOME");
    142     if (gsdl3Root == null) {
    143         System.out.println("Error: Unable to locate GSDL3HOME");
    144         System.exit(1);
    145         //return;
    146     }
    147    
     139  public CollectionManager(String site, String collection) {
     140   
     141    String gsdl3Root = System.getProperty("GSDL3HOME");
     142    if (gsdl3Root == null) {
     143      System.out.println("Error: Unable to locate GSDL3HOME");
     144      System.exit(1);
     145      //return;
     146    }
     147   
    148148    this.siteHome = GSFile.siteHome(gsdl3Root, site);
    149149    File site_dir = new File(this.siteHome);
    150150    if (!site_dir.exists()) {
    151     System.out.println("Error: Non-existant site ("+site+") specified");
    152     System.exit(1);
     151      System.out.println("Error: Non-existant site ("+site+") specified");
     152      System.exit(1);
    153153    }
    154154    site_dir = null;
     
    157157    File collect_dir = new File(this.collectionHome);
    158158    if (!collect_dir.exists()) {
    159     System.out.println("Error: Non-existant collection ("+collection+") specified in site "+site);
    160     System.exit(1);
     159      System.out.println("Error: Non-existant collection ("+collection+") specified in site "+site);
     160      System.exit(1);
    161161    }
    162162    collect_dir = null;
     
    165165    this.qualifiedCollectionName = site+"_"+collection;
    166166
    167       this.database = GS3SQLConnectionFactory.createConnection(this.qualifiedCollectionName);
     167    this.database = GS3SQLConnectionFactory.createConnection(this.qualifiedCollectionName);
    168168    /*    if (this.database != null) {
    169169      this.database.clearCollection(collection);
     
    178178    this.metadata = new CollectionMetadata();
    179179
    180    
    181180    File buildDirectory = new File(GSFile.collectionBuildDir(this.collectionHome));
    182181    if (!buildDirectory.exists()) {
     
    201200
    202201    try {
    203       etcURL = new URL("file://"+etcFile.toString());
     202      etcURL = URLTools.getFileURL(etcFile);
    204203    }
    205204    catch (java.net.MalformedURLException malEx) {
Note: See TracChangeset for help on using the changeset viewer.