# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.media
Class MediaFileSource

    java.lang.Object
      com.google.gdata.data.media.BaseMediaSource
          com.google.gdata.data.media.MediaFileSource

All Implemented Interfaces:
  MediaSource, javax.activation.DataSource

    public class MediaFileSource

extends BaseMediaSource

The MediaFileSource class provides a basic implementation of the `MediaSource` interface that reads media data from a `File`. The content length will be initialized to the file length, the last modified time to the file modification time, and the name of the source will be the name (last path element) of the file.

See Also:
  `MediaSource`

Nested Class Summary

Nested classes/interfaces inherited from interface com.google.gdata.data.media.MediaSource
`MediaSource.Output`

Field Summary

Fields inherited from class com.google.gdata.data.media.BaseMediaSource
`contentLength, etag, lastModified, mediaType, name`

Constructor Summary
`MediaFileSource(java.io.File mediaFile, java.lang.String mediaType)`

Method Summary
`java.io.InputStream` `getInputStream()`
`java.io.File` `getMediaFile()`
`java.io.OutputStream` `getOutputStream()`

Methods inherited from class com.google.gdata.data.media.BaseMediaSource
`getContentLength, getContentType, getEtag, getLastModified, getName, setContentLength, setEtag, setLastModified, setName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MediaFileSource

    public MediaFileSource(java.io.File mediaFile,
                           java.lang.String mediaType)

Method Detail

### getInputStream

    public java.io.InputStream getInputStream()
                                       throws java.io.IOException

  Throws:
    `java.io.IOException`

### getOutputStream

    public java.io.OutputStream getOutputStream()

### getMediaFile

    public java.io.File getMediaFile()