DataONEorg / rdataone

R package for reading and writing data at DataONE data repositories
http://doi.org/10.5063/F1M61H5X
36 stars 19 forks source link

Revert "Allow download of object if specify path in getObject" #220

Closed maier-m closed 6 years ago

maier-m commented 6 years ago

Reverts DataONEorg/rdataone#208

maier-m commented 6 years ago

Reverts https://github.com/DataONEorg/rdataone/pull/208 and then creates a new function D1Client function downloadObject to address https://github.com/DataONEorg/rdataone/issues/217

gothub commented 6 years ago

@maier-m The revert and addition of downloadObject() looks great. One question about downloadObject() - it looks like the file extension for formatId application/octet-stream is .data. Is there any reason for not using this?

maier-m commented 6 years ago

@gothub Yes, great question. As far as I know, application/octet-stream is used as a default when a formatID can not be made. I was worried about applying .data to files that should have legitimate other extensions. For example, new MATLAB file formatIDs were recently entered into D1. Therefore, previously entered MATLAB files may have formatID application/octet-stream and was worried about calling these files .data when they should be in fact .mat. I thought maybe no extension was better than a misleading one. Then again, this will only be an issue if the fileName is not specified. Not 100% sure this is the best approach though and would be fine with removing this behavior.