sk.baka.ambient.collection
Class MediaStoreAudio

java.lang.Object
  extended by sk.baka.ambient.collection.AbstractAudio
      extended by sk.baka.ambient.collection.MediaStoreAudio

public final class MediaStoreAudio
extends AbstractAudio

Denotes a file in the MediaStore.

Author:
Martin Vysny

Constructor Summary
MediaStoreAudio(String uri)
          Creates new object instance.
 
Method Summary
 boolean exists()
          Checks if the file denoted by this object exists.
 String getMimeType()
          Returns the file MIME type.
 long getSize()
          Returns file size, in bytes.
 boolean isReadable()
          Checks if the file denoted by this object is readable (i.e.
 InputStream openInputStream()
          Reads the file contents.
 
Methods inherited from class sk.baka.ambient.collection.AbstractAudio
fromUri, getLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaStoreAudio

MediaStoreAudio(String uri)
Creates new object instance.

Parameters:
uri - the "content://" URI.
Method Detail

exists

public boolean exists()
Description copied from class: AbstractAudio
Checks if the file denoted by this object exists.

Specified by:
exists in class AbstractAudio
Returns:
true if the file exists, false otherwise.

getMimeType

public String getMimeType()
Description copied from class: AbstractAudio
Returns the file MIME type.

Specified by:
getMimeType in class AbstractAudio
Returns:
MIME type, never null.

getSize

public long getSize()
Description copied from class: AbstractAudio
Returns file size, in bytes.

Specified by:
getSize in class AbstractAudio
Returns:
the file size.

isReadable

public boolean isReadable()
Description copied from class: AbstractAudio
Checks if the file denoted by this object is readable (i.e. user has rights to read the file, etc).

Specified by:
isReadable in class AbstractAudio
Returns:
true if the file is readable, false otherwise.

openInputStream

public InputStream openInputStream()
                            throws IOException
Description copied from class: AbstractAudio
Reads the file contents.

Specified by:
openInputStream in class AbstractAudio
Returns:
input stream instance, never null.
Throws:
IOException - if i/o error occurs.


Copyright © 2007-2008. All Rights Reserved.