com.melloware.jukes.file
Class MusicDirectory
java.lang.Object
com.melloware.jukes.file.MusicDirectory
public final class MusicDirectory
- extends java.lang.Object
This class is used for working with music file directories. Functions said as
loading a directory into the database, updating ID3 tags, etc.
Copyright (c) 2006 Melloware, Inc.
- Version:
- 4.0
- Author:
- Emil A. Lefkof III
- See Also:
MusicTag
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createNewDisc
public static JukesValidationMessage createNewDisc(java.lang.Object[] aTags,
java.io.File aCoverImage,
java.io.File aDirectory,
JukesValidationMessage aMessage,
boolean aUpdateTags)
- Creates a new disc in the catalog and optionally updates its ID3 tags.
- Parameters:
aTags - the array of MusicTag objectsaCoverImage - the cover imageaDirectory - the directory where these files are locatedaUpdateTags - true to update tags, false to not modify them
- Returns:
- a validation message containing the result
findLargestImageFile
public static java.io.File findLargestImageFile(java.io.File aDirectory)
- Loops through an array of files and determines the largest one in bytes.
- Parameters:
aDirectory - the directory to look for the largest file in.
- Returns:
- the file found to be the largest
findMusicFiles
public static java.util.Collection findMusicFiles(java.io.File aDirectory)
- For a directory gets all of its music type files into a collection. If
none are found return null, and set the validation message.
- Parameters:
aDirectory - the directory to scan
- Returns:
- a collection of files or NULL if not found
loadDiscFromDirectory
public static JukesValidationMessage loadDiscFromDirectory(java.io.File aDirectory,
boolean aUpdateTags)
- Silently loads all tracks and one image file from the aDirectory. It must
be a directory and if any exception is thrown all we do is return false to
silently report the error.
- Parameters:
aDirectory - the directory to addaUpdateTags - boolean whether to overwrite new tags or not
- Returns:
- true if successful, false if any error
removeDiscIfNoLongerExists
public static boolean removeDiscIfNoLongerExists(Disc aDisc)
- Checks for the disc at the location on the hard drive. If that location no
longer exists on the hard drive then this disc is removed from the
database. This is useful for when using the Jukes with portable storage
devices like Archos Jukebox. Thanks to Bill Farkas for suggesting this
feature.
- Parameters:
aDisc - the disc to check the hard drive for
- Returns:
- true if the disc was OK, false if the disc was removed
Copyright © 1999-2008 Melloware Inc. All Rights Reserved.