net.sourceforge.pavlov.randommedia
Class AbstractMediaDirectory

java.lang.Object
  extended by net.sourceforge.pavlov.randommedia.AbstractMediaDirectory
Direct Known Subclasses:
RandomMediaDirectory, SequencedMediaDirectory

public abstract class AbstractMediaDirectory
extends Object

A filesystem directory (with subdirectories and JAR files) full of media items.


Constructor Summary
AbstractMediaDirectory(File dir, ZipCapableFileFilter filt)
          Creates and initializes a RandomMediaDirectory object with the given directory and fileFilter.
AbstractMediaDirectory(File dir, ZipCapableFileFilter filt, boolean shouldRefresh)
          Creates and initializes a RandomMediaDirectory object with the given file and fileFilter.
 
Method Summary
protected  boolean acceptEntry(JarEntry j)
          Describe acceptEntry method here.
protected  boolean acceptFile(File f)
          Describe acceptFile method here.
protected  void addSubdirectory(File f)
          Describe addSubdirectory method here.
protected  void addURL(URL u)
          Describe addURL method here.
protected  void clearURLs()
          Describe clearURLs method here.
protected  String getAbsoluteDirectoryPath()
          Describe getAbsoluteDirectoryPath method here.
 File getDirectory()
          Get the Directory.
protected  String getDirectoryString()
          Describe getDirectoryString method here.
 String getName()
          Returns the file name of this directory.
 int getSize()
          Number of media URL's in this directory.
 Vector<File> getSubdirectories()
          Return all subdirectories in this directory.
protected  URL getURLIndex(int i)
          Describe getURLIndex method here.
 Vector<URL> getURLVector()
          Return all media URLs in this directory.
 boolean isEnabled()
          If this directory is enabled
protected  File[] listFiles()
          Describe listFiles method here.
protected  void setDirectory(File newDirectory)
          Set the Directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMediaDirectory

public AbstractMediaDirectory(File dir,
                              ZipCapableFileFilter filt)
Creates and initializes a RandomMediaDirectory object with the given directory and fileFilter.

Parameters:
dir - a File value
filt - a ZipCapableFileFilter value

AbstractMediaDirectory

public AbstractMediaDirectory(File dir,
                              ZipCapableFileFilter filt,
                              boolean shouldRefresh)
Creates and initializes a RandomMediaDirectory object with the given file and fileFilter.

Parameters:
dir - a File value
filt - a ZipCapableFileFilter value
shouldRefresh - a boolean value
Method Detail

getDirectory

public File getDirectory()
Get the Directory.

Returns:
the File value.

setDirectory

protected void setDirectory(File newDirectory)
Set the Directory.

Parameters:
newDirectory - a File value

listFiles

protected File[] listFiles()
Describe listFiles method here.

Returns:
a File[] value

getAbsoluteDirectoryPath

protected String getAbsoluteDirectoryPath()
Describe getAbsoluteDirectoryPath method here.

Returns:
a String value

getDirectoryString

protected String getDirectoryString()
Describe getDirectoryString method here.

Returns:
a String value

addSubdirectory

protected void addSubdirectory(File f)
Describe addSubdirectory method here.

Parameters:
f - a File value

addURL

protected void addURL(URL u)
Describe addURL method here.

Parameters:
u - an URL value

clearURLs

protected void clearURLs()
Describe clearURLs method here.


getURLIndex

protected URL getURLIndex(int i)
Describe getURLIndex method here.

Parameters:
i - an int value
Returns:
an URL value

getName

public String getName()
Returns the file name of this directory.

Returns:
a String value

acceptEntry

protected boolean acceptEntry(JarEntry j)
Describe acceptEntry method here.

Parameters:
j - a JarEntry value
Returns:
a boolean value

acceptFile

protected boolean acceptFile(File f)
Describe acceptFile method here.

Parameters:
f - a File value
Returns:
a boolean value

getURLVector

public Vector<URL> getURLVector()
Return all media URLs in this directory.

Returns:
a Vector value

getSubdirectories

public Vector<File> getSubdirectories()
Return all subdirectories in this directory.

Returns:
a Vector value

isEnabled

public boolean isEnabled()
If this directory is enabled

Returns:
a boolean value

getSize

public int getSize()
Number of media URL's in this directory.

Returns:
an int value