Task #3365
Story #3309: get() downloads have inconsistent mime types and filenames
create Java ObjectFormatInfo class to provide mime lookup
100%
Description
We will use utility classes in libclient to provide a consistent lookup service to allow applications to find out the mime type and file extension for formatIDs. Create an ObjectFormatInfo class that provides:
* a static singleton that can be called from anywhere in an application
* function to find the mime type based on a formt identifier string
* function to find the mime type based on an ObjectFormat instance
* function to find the extension based on a formt identifier string
* function to find the extension based on an ObjectFormat instance
* a default set of mapping data that ships with libclient as a CSV file
* the ability for calling applications to set a property (D1Client.resourcesDir) that determines where this CSV data file will live on disk
* the ObjectFormatInfo class should be able to reload itself at runtime, re-reading the CSV file so applications can refresh mappings without a restart
History
#1 Updated by Matthew Jones about 12 years ago
- Status changed from In Progress to Testing
Implemented the ObjectFormatInfo class and associated CSV file. Created JUnit test to run some simple sanity checks on operation. After testing and review, this task can be closed if no new issues are identified.
#2 Updated by Matthew Jones about 12 years ago
Usage of the class uses calls such as:
@
String mimetype = ObjectFormatInfo.instance().getMimeType("netCDF-3");
String extension = ObjectFormatInfo.instance().getExtension("netCDF-3");
@
#3 Updated by Ben Leinfelder about 12 years ago
Now using in Metacat trunk -- initial testing looks good.
#4 Updated by Ben Leinfelder about 12 years ago
Changes to local file were reflected in download.
Moving mapping file to new location and point configuration to that location worked, too.
I'm happy with this feature.
#5 Updated by Matthew Jones about 12 years ago
- translation missing: en.field_remaining_hours set to 0.0
- % Done changed from 90 to 100
- Status changed from Testing to Closed
Tetsing successful with Metacat, so closing.
#6 Updated by Chris Jones almost 12 years ago
- Target version changed from Sprint-2012.44-Block.6.2 to 2013.2-Block.1.1
#7 Updated by Chris Jones over 11 years ago
- Target version changed from 2013.2-Block.1.1 to 2013.12-Block.2.2
#8 Updated by Dave Vieglais over 11 years ago
- Target version changed from 2013.12-Block.2.2 to 2013.35-Block.5.1
#9 Updated by Chris Jones almost 11 years ago
- Target version changed from 2013.35-Block.5.1 to 2014.6-Block.1.3
#10 Updated by Roger Dahl over 10 years ago
- Target version changed from 2014.6-Block.1.3 to 2014.14-Block.2.3
#11 Updated by Dave Vieglais about 10 years ago
- Target version changed from 2014.14-Block.2.3 to CCI-1.4.2
#12 Updated by Dave Vieglais about 10 years ago
- Target version changed from CCI-1.4.2 to CCI-1.5.0
#13 Updated by Dave Vieglais about 10 years ago
- Target version changed from CCI-1.5.0 to CCI-2.0.0