agave-common/common-api/src/main/java/org/iplantc/service/common/restlet/resource/AbstractAgaveServerResource.java
/**
	 * Resolves a mimetype based on the filename.
	 * @param filename
	 * @return
	 */
Resolves a mimetype based on the filename.
@param filename
@return
Resolves a mimetype based on the filename . @param filename @return
public String resolveMimeTime(String filename) {
		InputStream mimeTypesStream = null;
		try {
			mimeTypesStream = this.getClass().getClassLoader().getResourceAsStream("mime.types");
			MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap(mimeTypesStream);
			return mimeTypesMap.getContentType(filename);
		} catch (Exception e) {
			log.error(e.getMessage(), e);
			try {return new MimetypesFileTypeMap().getContentType(filename);}
				catch (Exception e2) {
					log.error(e2.getMessage(), e2);
					throw e2;
				}
		} finally {
			if (mimeTypesStream != null) try {mimeTypesStream.close();} catch (Exception e){}
		}
	}
public String resolveMimeTime ( String filename ) { InputStream mimeTypesStream = null ; try { mimeTypesStream = this . getClass ( ) . getClassLoader ( ) . getResourceAsStream ( "mime.types" ) ; MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap ( mimeTypesStream ) ; return mimeTypesMap . getContentType ( filename ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; try { return new MimetypesFileTypeMap ( ) . getContentType ( filename ) ; } catch ( Exception e2 ) { log . error ( e2 . getMessage ( ) , e2 ) ; throw e2 ; } } finally { if ( mimeTypesStream != null ) try { mimeTypesStream . close ( ) ; } catch ( Exception e ) { } } }
Resolves a mimetype based on the filename.
Resolves a mimetype based on the filename .
// Try again on a different map.