Class FileDirectoryManager
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getAppConfigDirectory
(String subDirName) Get the user specific JJazz configuration directory.Get the Netbeans application installation directory.static FileDirectoryManager
The directory user.home/DEFAULT_USER_DIR.The last directory used for song open or song save.getOldAppConfigFile
(String oldVersion, String relPath) Get the File object corresponding to an existing file (or subdirectory) in the AppConfig directory of an old JJazzLab version.Get the directory used for rhythm's default mix files.getRhythmMixFile
(String rhythmName, File rhythmFile) Get the rhythm mix File object for the specified rhythm.getSongMixFile
(File songFile) Build the song mix File object for specified song file.Get the user directory for Rhythms files.boolean
void
void
setLastSongDirectory
(File dir) Set the last song directory.void
Set the user directory where to find rhythm default mix files.void
setUseRhyhtmUserDirAsRhythmDefaultMixDir
(boolean b) If b is true getRhythmMixDirectory() will return the same value as getUserRhythmDirectory().void
Set the user directory where to find rhythm files.
-
Field Details
-
APP_CONFIG_PREFIX_DIR
- See Also:
-
JJAZZLAB_USER_DIR
- See Also:
-
TEMPLATE_SONG_NAME
- See Also:
-
MIX_FILE_EXTENSION
- See Also:
-
SONG_EXTENSION
- See Also:
-
PROP_LAST_SONG_DIRECTORY
- See Also:
-
PROP_RHYTHM_USER_DIRECTORY
- See Also:
-
PROP_RHYTHM_MIX_DIRECTORY
- See Also:
-
PROP_USE_RHYTHM_USER_DIR_FOR_RHYTHM_DEFAULT_MIX
- See Also:
-
-
Constructor Details
-
FileDirectoryManager
public FileDirectoryManager()
-
-
Method Details
-
getInstance
-
getSongMixFile
Build the song mix File object for specified song file.SongMix file will be located in the same directory than songFile.
- Parameters:
songFile
-- Returns:
- Return a new file identical to songFile except the extension. If songFile is null returns null.
-
getRhythmMixFile
Get the rhythm mix File object for the specified rhythm.- Parameters:
rhythmName
-rhythmFile
- Can be empty (no file) but can not null.- Returns:
-
getNewSongTemplateMixFile
-
getNewSongTemplateSongFile
-
getJJazzLabUserDirectory
The directory user.home/DEFAULT_USER_DIR.Directory is created if it does not exist.
- Returns:
- Can't be null. Default to user.home property.
-
getInstallationDirectory
Get the Netbeans application installation directory.This is the top-level directory which contains subdirectories such as bin, etc, platform, ...
- Returns:
- Can't be null
-
getUserRhythmDirectory
Get the user directory for Rhythms files.If not set use by default the System property "user.home".
- Returns:
- Can't be null
-
setUserRhythmDirectory
Set the user directory where to find rhythm files.- Parameters:
dir
-
-
getRhythmMixDirectory
Get the directory used for rhythm's default mix files.If isUseRhyhtmUserDirAsRhythmDefaultMixDir() is true use the same default value than getUserRhythmDirectory().
- Returns:
- Can't be null.
-
setRhythmMixDirectory
Set the user directory where to find rhythm default mix files.- Parameters:
dir
-
-
isUseRhyhtmUserDirAsRhythmDefaultMixDir
public boolean isUseRhyhtmUserDirAsRhythmDefaultMixDir() -
setUseRhyhtmUserDirAsRhythmDefaultMixDir
public void setUseRhyhtmUserDirAsRhythmDefaultMixDir(boolean b) If b is true getRhythmMixDirectory() will return the same value as getUserRhythmDirectory().- Parameters:
b
-
-
getAppConfigDirectory
Get the user specific JJazz configuration directory.Use the APP_CONFIG_PREFIX_DIR subdir of the Netbeans user directory, or if not set of the user.home system property. Create the directory if it does not exist.
- Parameters:
subDirName
- An optional extra subdirectory name (APP_CONFIG_PREFIX_DIR/subDir). Ignored if null or empty.- Returns:
- Could be null if no user directory found.
-
getOldAppConfigFile
Get the File object corresponding to an existing file (or subdirectory) in the AppConfig directory of an old JJazzLab version.For example on Windows, if oldVersion="2.0.1" and relPath="subdir/hello.properties" and this files exists, method returns the File at <WindowsUserDir>/AppData/Roaming/jjazzlab/2.0.1/.jjazz/subdir/hello.properties".
- Parameters:
relPath
- The relative path to the file from the old AppConfig directory. If null returns the AppConfig directory.oldVersion
- E.g. "2.0.1"- Returns:
- Null if relPath does not corresponding to an existing file
-
getLastSongDirectory
The last directory used for song open or song save.If not set return getJJazzLabUserDirectory() unless it does not exist anymore.
- Returns:
- Can be null
-
setLastSongDirectory
Set the last song directory.- Parameters:
dir
-
-
addPropertyChangeListener
-
removePropertyChangeListener
-