|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dlese.dpc.oai.OAIUtils
public final class OAIUtils
Contains utility methods used in OAI.
| Constructor Summary | |
|---|---|
OAIUtils()
|
|
| Method Summary | |
|---|---|
static String |
decode(String msg)
Decode an identifier or resumption token. |
static String |
encode(String msg)
Encode an identifier or resumption token. |
static Date |
getDateFromDatestamp(String datestamp)
Converts an ISO8601 UTC datestamp String of the form yyyy-MM-ddTHH:mm:ssZ or the short form yyyy-MM-dd to a Java Date. |
static Date |
getDateFromDatestamp(String datestamp,
long increment)
Converts an ISO8601 UTC datastamp String of the form yyyy-MM-ddTHH:mm:ssZ or the short form yyyy-MM-dd to a Java Date. |
static String |
getDatestampFromDate(Date date)
Gets an ISO8601 UTC datestamp string of the form yyyy-MM-ddTHH:mm:ssZ from a Date. |
static String |
getHarvestedDirBaseURLPath(String basePath,
String baseURL)
Creates an appropriate directory path where harvested file(s) are saved similar to wget paths based on the URI. |
static String |
getHarvestedDirPath(String basePath,
String setname,
String prefix,
String baseURL)
Creates an appropriate directory path where harvested file(s) are saved based on the baseURL, format and set. |
static long |
getLongFromDatestamp(String datestamp)
Converts an ISO8601 UTC datastamp String of the form yyyy-MM-ddTHH:mm:ssZ to a long. |
static long |
getLongFromDatestamp(String datestamp,
long increment)
Converts an ISO8601 UTC datastamp String of the form yyyy-MM-ddTHH:mm:ssZ to a long. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OAIUtils()
| Method Detail |
|---|
public static final String getDatestampFromDate(Date date)
date - The Date
getDateFromDatestamp(java.lang.String)
public static final Date getDateFromDatestamp(String datestamp)
throws ParseException
datestamp - A datestamp in UTC format.
ParseException - If unable to interpret the datestamp.
public static final Date getDateFromDatestamp(String datestamp,
long increment)
throws ParseException
datestamp - A datestamp in UTC format.increment - Number of seconds to increment the date, positive or negative, or 0 to leave
unchanged.
ParseException - If unable to interpret the datestamp.
public static final long getLongFromDatestamp(String datestamp)
throws ParseException
datestamp - A datestamp in UTC format.
ParseException - If unable to interpret the datestamp.
public static final long getLongFromDatestamp(String datestamp,
long increment)
throws ParseException
datestamp - A datestamp in UTC format.increment - Number of seconds to increment the date, positive or negative, or 0 to leave
unchanged.
ParseException - If unable to interpret the datestamp.
public static String getHarvestedDirBaseURLPath(String basePath,
String baseURL)
basePath - The base output directory.baseURL - The baseURL of the OAI data provider.
public static String getHarvestedDirPath(String basePath,
String setname,
String prefix,
String baseURL)
basePath - The base output directory.setname - The OAI setSpec harvested, or null if none.prefix - The metadataPrefix (format) harvested.baseURL - The baseURL of the OAI data provider.
public static String encode(String msg)
throws Exception
See section 3.1.1.3 in http://www.openarchives.org/OAI/2.0/openarchivesprotocol.htm
msg - A String to encode.
Exception - If error
public static String decode(String msg)
throws Exception
See section 3.1.1.3 in http://www.openarchives.org/OAI/2.0/openarchivesprotocol.htm
msg - Message to decode
Exception - If unable to decode.
|
DLESE Tools v1.6.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||