Project

General

Profile

« Previous | Next » 

Revision 9541

ensure there is a file extension included for the data files in a package download. https://projects.ecoinformatics.org/ecoinfo/issues/6970

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
2399 2399
					//Let's use the file name and extension from the metadata is we have it
2400 2400
					fileName = entryPid.getValue().replaceAll("[^a-zA-Z0-9\\-\\.]", "_") + "-" + fileNames.get(entryPid).replaceAll("[^a-zA-Z0-9\\-\\.]", "_");
2401 2401
				}
2402
				else{
2403
					//If we couldn't find a given file name, use the system metadata extension
2404
					String extension = ObjectFormatInfo.instance().getExtension(entrySysMeta.getFormatId().getValue());
2405
					fileName += extension;
2406
				}
2407 2402
				
2403
				// ensure there is a file extension for the object
2404
				String extension = ObjectFormatInfo.instance().getExtension(entrySysMeta.getFormatId().getValue());
2405
				fileName += extension;
2406
				
2408 2407
		        //Create a new file for this item and add to the list
2409 2408
				File tempFile = new File(tempDir, fileName);
2410 2409
				tempFiles.add(tempFile);

Also available in: Unified diff