From: Moisés B. R. <moi...@us...> - 2005-04-09 02:45:11
|
Update of /cvsroot/gbif/gbifPortal/src/org/gbif/connect/digir In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17963/connect/digir Modified Files: DiGIRMetadataRecord.java Log Message: MetadataRecord now has a method to get the last updated date of a resource. This field comes from the following XML paths according to protocol: - DiGIR with Darwin Core: /response/content/metadata/provider/resource/dateLastUpdated - BioCASe with ABCD 1.2: /DataSets/DataSet/OriginalSource/SourceLastUpdatedDate - BioCASe with ABCD 1.48: /DataSets/DataSet/LastUpdatedDate The XsdDateTime class is responsible for converting the string in these fields into a java.sql.Timestamp. Index: DiGIRMetadataRecord.java =================================================================== RCS file: /cvsroot/gbif/gbifPortal/src/org/gbif/connect/digir/DiGIRMetadataRecord.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DiGIRMetadataRecord.java 20 Aug 2004 16:23:39 -0000 1.1.1.1 --- DiGIRMetadataRecord.java 9 Apr 2005 02:44:31 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- import java.net.URL; import java.util.ArrayList; + import java.sql.Timestamp; import org.apache.log4j.Logger; import org.gbif.util.XmlDocument; *************** *** 41,44 **** --- 42,47 ---- import org.gbif.connect.Request; import org.gbif.connect.ResponseFragment; + import org.gbif.util.XsdDateTime; + /**************************************************************************** *************** *** 69,72 **** --- 72,76 ---- public static final String PATH_USAGE = "resource/useRestrictions"; public static final String PATH_RECORDCOUNT = "resource/numberOfRecords"; + public static final String PATH_LASTUPDATED = "resource/dateLastUpdated"; public static final String ATTRIBUTE_TYPE = "type"; *************** *** 278,280 **** --- 282,295 ---- return Integer.parseInt(get(PATH_RECORDCOUNT)); } + + /** + * Get timestamp of the resource associated with this Record. + * + * @return Timestamp the resource timestamp + */ + public Timestamp getResourceLastUpdated() + throws ConnectionException + { + return XsdDateTime.toTimestamp(get(PATH_LASTUPDATED)); + } } \ No newline at end of file |