Class FileSystemLibraryDescriptor
- java.lang.Object
-
- com.tagtraum.beatunes.library.LibraryDescriptor
-
- com.tagtraum.beatunes.library.filesystem.FileSystemLibraryDescriptor
-
public class FileSystemLibraryDescriptor extends LibraryDescriptor
Filesystem-based library descriptor.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description FileSystemLibraryDescriptor()FileSystemLibraryDescriptor(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRoot(Path file)LibraryLoadercreateLibraryLoader()Creates a library loader appropriate for this kind of library.booleanequals(Object o)booleanexists()Indicates whether the library described by this instance actually exists.StringgetIdAsString()Library id asString.longgetLastModified()If this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.StringgetName()Name.Path[]getRoots()inthashCode()booleanneedsRefresh(long lastSync)Indicates whether we might want to sync this library.StringtoString()AudioSongwrap(AudioSong audioSong)Wraps an internal database song into anotherAudioSongthat is capable of writing/reading data to external databases or files (e.g.PlayListwrap(PlayList playList)Wraps an internal database playlist into anotherPlayListthat is capable of writing/reading data to external databases or files.-
Methods inherited from class com.tagtraum.beatunes.library.LibraryDescriptor
getId, getMediaLibrary, setMediaLibrary
-
-
-
-
Constructor Detail
-
FileSystemLibraryDescriptor
public FileSystemLibraryDescriptor(String id)
-
FileSystemLibraryDescriptor
public FileSystemLibraryDescriptor()
-
-
Method Detail
-
addRoot
public void addRoot(Path file)
-
getName
public String getName()
Description copied from class:LibraryDescriptorName. E.g. "iTunes".- Specified by:
getNamein classLibraryDescriptor- Returns:
- library name
-
getRoots
public Path[] getRoots()
- Returns:
- alphabetically sorted roots
-
getLastModified
public long getLastModified()
Description copied from class:LibraryDescriptorIf this library descriptor describes a document or is capable of determining the last modification of the library as a whole, this method returns the date.- Specified by:
getLastModifiedin classLibraryDescriptor- Returns:
- date of last modification or 0 if unknown
-
needsRefresh
public boolean needsRefresh(long lastSync)
Description copied from class:LibraryDescriptorIndicates whether we might want to sync this library. If this cannot determined accurately, this method returnstrue.- Specified by:
needsRefreshin classLibraryDescriptor- Parameters:
lastSync- date of last sync- Returns:
- true, if we should probably sync
-
getIdAsString
public String getIdAsString()
Description copied from class:LibraryDescriptorLibrary id asString.- Specified by:
getIdAsStringin classLibraryDescriptor- Returns:
- id
- See Also:
PersistentId.idStringToLong(String)
-
exists
public boolean exists()
Description copied from class:LibraryDescriptorIndicates whether the library described by this instance actually exists. Defaults totrue.- Overrides:
existsin classLibraryDescriptor- Returns:
- true or false
-
createLibraryLoader
public LibraryLoader createLibraryLoader()
Description copied from class:LibraryDescriptorCreates a library loader appropriate for this kind of library.- Specified by:
createLibraryLoaderin classLibraryDescriptor- Returns:
- library loader
-
wrap
public AudioSong wrap(AudioSong audioSong)
Description copied from class:LibraryDescriptorWraps an internal database song into anotherAudioSongthat is capable of writing/reading data to external databases or files (e.g.TrackorAudioMetaData). Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrapin classLibraryDescriptor- Parameters:
audioSong- song object to be wrapped, e.g.Song- Returns:
- wrapper
-
wrap
public PlayList wrap(PlayList playList)
Description copied from class:LibraryDescriptorWraps an internal database playlist into anotherPlayListthat is capable of writing/reading data to external databases or files. Depending on the kind of library, this wrapper might be quite different.- Specified by:
wrapin classLibraryDescriptor- Parameters:
playList- song object to be wrapped, e.g.HibernatePlayList- Returns:
- wrapper
-
-