arcticdatautils::publish_object() has a lot of nice functionality that would be nice to include in an Arctic Data Center (or even DataOne?) specific function:
guessing and checking the format
if (is.null(format_id)) {
format_id <- guess_format_id(path)
if (format_id == "application/xml") {
stop(call. = FALSE, "No format_id was specified and this appears to be an XML document. Please specify the format_id and run this call again.")
}
warning(paste0("No format_id was specified so a guess was made based upon the file extension: ",
format_id, "."))
}
check_format(format_id)
2. generating the id
pid <- new_uuid()
This will help reduce mistakes that might occur when creating a new dataObject
arcticdatautils::publish_object()
has a lot of nice functionality that would be nice to include in an Arctic Data Center (or even DataOne?) specific function:check_format(format_id)
pid <- new_uuid()
new("DataObject", id=paste0("urn:uuid:", UUIDgenerate()), format="application/octet-stream", filename= "../../../visitor/Flanner/mc_ssa_cal.tar.gz", targetPath = "mc_ssa_cal.tar.gz")