sk.baka.ambient.collection
Class FileAudio

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

public final class FileAudio
extends AbstractAudio

Denotes a file on the filesystem.

Author:
Martin Vysny

Constructor Summary
FileAudio(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

FileAudio

FileAudio(String uri)
Creates new object instance.

Parameters:
uri - the file location.
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.

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.

getSize

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

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


Copyright © 2007-2008. All Rights Reserved.