|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.MediaDirectory
public class MediaDirectory
Used to represent a directory that contains media and can be managed by MediaManager
Constructor Summary | |
---|---|
MediaDirectory(Controller controller,
ConfigReader config,
java.io.File mediaDir)
The constructor |
Method Summary | |
---|---|
protected void |
createSearchers()
|
void |
fileChanged(java.io.File file)
This is called to notify stores that a file has changed. |
java.util.List<IAction> |
getActions()
Get the actions been used by the media directory |
Controller |
getController()
Used to get the media controller |
IEpisode |
getEpisode(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season,
int episodeNum,
boolean refresh)
Get a episode with a given episode number. |
IFilm |
getFilm(java.io.File rootMediaDir,
java.io.File filmFile,
SearchResult searchResult,
boolean refresh)
Get a film with a given film id and source id. |
MediaDirConfig |
getMediaDirConfig()
Get the configuration of the media directory |
java.io.File |
getPath(java.lang.String name)
Used to get the full location of a file within the media directory |
ISeason |
getSeason(java.io.File rootMediaDir,
java.io.File episodeFile,
IShow show,
int seasonNum,
boolean refresh)
Get a season with a given season number. |
IShow |
getShow(java.io.File rootMediaDir,
java.io.File episodeFile,
SearchResult searchResult,
boolean refresh)
Get a show with a given show id and source id. |
java.util.List<ISource> |
getSources()
Get the sources been used by the media directory |
IEpisode |
getSpecial(java.io.File rootMediaDir,
java.io.File specialFile,
ISeason season,
int specialNum,
boolean refresh)
Get a special episode with a given special episode number. |
java.util.List<IStore> |
getStores()
Get the stores been used by the media directory |
void |
renamedFile(java.io.File rootMediaDir,
java.io.File oldFile,
java.io.File newFile)
This is used when a file that holds a episode or film has been renamed |
SearchResult |
searchForVideoId(java.io.File mediaFile,
boolean useSources)
This will search for a show id in the stores and sources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MediaDirectory(Controller controller, ConfigReader config, java.io.File mediaDir) throws ConfigException
controller
- The media controllerconfig
- The configuration of the media directorymediaDir
- The location of the media directory
ConfigException
- Thrown if their is a problem reading the configurationMethod Detail |
---|
protected void createSearchers()
public IShow getShow(java.io.File rootMediaDir, java.io.File episodeFile, SearchResult searchResult, boolean refresh) throws java.net.MalformedURLException, SourceException, java.io.IOException, StoreException
rootMediaDir
- The root media directoryepisodeFile
- The file the episode is stored insearchResult
- The search results from looking for a showrefresh
- If true, then the stores are ignored.
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
SourceException
- Thrown if their is a source related problem.
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a store related problem.public IFilm getFilm(java.io.File rootMediaDir, java.io.File filmFile, SearchResult searchResult, boolean refresh) throws java.net.MalformedURLException, SourceException, java.io.IOException, StoreException
rootMediaDir
- The root media directoryfilmFile
- The file the film is stored insearchResult
- The resulting film from a searchrefresh
- If true, then the stores are ignored.
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
SourceException
- Thrown if their is a source related problem.
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a store related problem.public ISeason getSeason(java.io.File rootMediaDir, java.io.File episodeFile, IShow show, int seasonNum, boolean refresh) throws SourceException, java.io.IOException, StoreException
rootMediaDir
- The root media directoryepisodeFile
- The file the episode is stored inshow
- The show the season belongs tooseasonNum
- The season numberrefresh
- If true, then the stores are ignored.
SourceException
- Thrown if their is a source related problem.
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a store related problem.public IEpisode getEpisode(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season, int episodeNum, boolean refresh) throws SourceException, java.net.MalformedURLException, java.io.IOException, StoreException
rootMediaDir
- The root media directoryseason
- The season the episode belongs tooepisodeNum
- The episode numberrefresh
- If true, then the stores are ignored.episodeFile
- The file the episode is stored in
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
SourceException
- Thrown if their is a source related problem.
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a store related problem.public IEpisode getSpecial(java.io.File rootMediaDir, java.io.File specialFile, ISeason season, int specialNum, boolean refresh) throws SourceException, java.net.MalformedURLException, java.io.IOException, StoreException
rootMediaDir
- The root media directoryseason
- The season the episode belongs toospecialNum
- The special episode numberrefresh
- If true, then the stores are ignored.specialFile
- The file the special episode is stored in
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
SourceException
- Thrown if their is a source related problem.
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a store related problem.public void fileChanged(java.io.File file) throws StoreException
file
- The file that has changed
StoreException
- Thrown if their are any problemspublic SearchResult searchForVideoId(java.io.File mediaFile, boolean useSources) throws SourceException, StoreException, java.net.MalformedURLException, java.io.IOException
mediaFile
- The file the media is stored inuseSources
- True to search sources, otherwise will only use stores
SourceException
- Thrown if their is a problem reading from a source
StoreException
- Thrown if their is a problem reading for a store
java.io.IOException
- Throw if their is a IO problem
java.net.MalformedURLException
- Throw if their is a problem creating a URLpublic void renamedFile(java.io.File rootMediaDir, java.io.File oldFile, java.io.File newFile) throws StoreException
rootMediaDir
- The root media directoryoldFile
- The old filenewFile
- The new file
StoreException
- Thrown if their is a problem renaming filespublic MediaDirConfig getMediaDirConfig()
public java.util.List<IStore> getStores()
public java.util.List<ISource> getSources()
public java.util.List<IAction> getActions()
public java.io.File getPath(java.lang.String name)
name
- the path of the file relative to the media directory
public Controller getController()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |