Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jersey.multipart.file
Interface MediaTypePredictor

All Known Implementing Classes:
  DefaultMediaTypePredictor

    public interface MediaTypePredictor

An interface which allows developers implement their own media type predictor.

Author:
  imran@smartitengineering.com, Paul.Sandoz@Sun.Com

Method Summary
`MediaType` | `getMediaTypeFromFile(java.io.File file)` Get the media type from a file name.
`MediaType` | `getMediaTypeFromFileName(java.lang.String fileName)` Get the media type from a file name.

Method Detail

### getMediaTypeFromFile

    MediaType getMediaTypeFromFile(java.io.File file)

  Get the media type from a file name.

  Parameters:
    `file` - The file from which to get the `MediaType`
  Returns:
    The `MediaType` for the give file; `null` - if file is null; "application/octet-stream" if extension not recognized.
  See Also:
    `DefaultMediaTypePredictor.CommonMediaTypes.getMediaTypeFromFileName(java.lang.String)`

### getMediaTypeFromFileName

    MediaType getMediaTypeFromFileName(java.lang.String fileName)

  Get the media type from a file name. If the file name extension is not recognised it will return `MediaType` for "*\/*", it will also return the same if the file is `null`.

  Parameters:
    `fileName` - The file name from which to get the `MediaType`
  Returns:
    The `MediaType` for the give file; `null` - if file is null; "application/octet-stream" if extension not recognized.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 Oracle Corporation. All Rights Reserved.