Project

General

Profile

« Previous | Next » 

Revision 9542

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
2395 2395
				//Our default file name is just the ID + format type (e.g. walker.1.1-DATA)
2396 2396
				fileName = entryPid.getValue().replaceAll("[^a-zA-Z0-9\\-\\.]", "_") + "-" + objectFormatType;
2397 2397

  
2398
				if(fileNames.containsKey(entryPid)){
2398
				if (fileNames.containsKey(entryPid)){
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
				}
......
2404 2404
				String extension = ObjectFormatInfo.instance().getExtension(entrySysMeta.getFormatId().getValue());
2405 2405
				fileName += extension;
2406 2406
				
2407
				// if SM has the file name, ignore everything else and use that
2408
				if (entrySysMeta.getFileName() != null) {
2409
					fileName = entrySysMeta.getFileName().replaceAll("[^a-zA-Z0-9\\-\\.]", "_");
2410
				}
2411
				
2407 2412
		        //Create a new file for this item and add to the list
2408 2413
				File tempFile = new File(tempDir, fileName);
2409 2414
				tempFiles.add(tempFile);

Also available in: Unified diff