Project

General

Profile

« Previous | Next » 

Revision 5915

Added by Matt Jones about 13 years ago

Cleanup harvester exceptions and generics.

View differences:

SpatialHarvester.java
24 24

  
25 25
package edu.ucsb.nceas.metacat.spatial;
26 26

  
27
import java.io.IOException;
28
import java.sql.PreparedStatement;
27 29
import java.sql.ResultSet;
28
import java.sql.PreparedStatement;
30
import java.sql.SQLException;
29 31
import java.util.Vector;
30
import java.io.IOException;
31 32

  
32 33
import org.apache.log4j.Logger;
34
import org.opengis.feature.simple.SimpleFeature;
33 35

  
34 36
import edu.ucsb.nceas.metacat.database.DBConnection;
35
import edu.ucsb.nceas.metacat.util.MetacatUtil;
36 37

  
37
import org.opengis.feature.simple.SimpleFeature;
38

  
39 38
/** 
40 39
 * Harvests spatial data from metacat database
41 40
 * and saves to persistent cache
......
65 64
  public void destroy() {
66 65
      try {
67 66
          dbconn.close();
68
      } catch( Exception e ) {
67
      } catch( SQLException e ) {
69 68
          log.error("Error closing out dbconn in spatial harvester");
70 69
          e.printStackTrace();
71 70
      }
......
74 73
  /**
75 74
   * Returns a Vector of all the docids in the xml_path_index tables
76 75
   */
77
  protected Vector queryAllDocids() {
78
    Vector _docs = new Vector();
76
  protected Vector<String> queryAllDocids() {
77
    Vector<String> _docs = new Vector<String>();
79 78
    PreparedStatement pstmt = null;
80 79
    ResultSet rs = null;
81 80

  
......
189 188
      SpatialDataset sds = new SpatialDataset();
190 189

  
191 190
      // Get list of all docids in the database
192
      Vector docids = queryAllDocids(); 
191
      Vector<String> docids = queryAllDocids(); 
193 192
       
194 193
      for (int i = 0; i < docids.size(); i++) {
195 194
          SpatialDocument sdoc = new SpatialDocument( (String)docids.elementAt(i), dbconn );

Also available in: Unified diff