Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.settings.Filenames Class Reference

Utility class to return references to settings files. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.settings.Filenames:

Static Public Member Functions

static File getDialogsFile (@NotNull final String skinName) throws IOException
 Returns the file for storing dialog related information for a skin. More...
 
static File getKeybindingsFile (@Nullable final CharSequence hostname, @Nullable final CharSequence character) throws IOException
 Returns the keybindings file. More...
 
static File getMagicMapImageCacheDir ()
 Returns the image cache directory for magic map sized images. More...
 
static File getMessageLogFile (@Nullable final String hostname) throws IOException
 Returns the log file for text message logging. More...
 
static File getMetaserverCacheFile ()
 Returns the metaserver cache file. More...
 
static File getOriginalImageCacheDir ()
 Returns the image cache directory. More...
 
static File getScaledImageCacheDir ()
 Returns the image cache directory for double size images. More...
 
static File getSettingsFile () throws IOException
 Returns the main settings file. More...
 
static File getSettingsFile (@NotNull final String filename) throws IOException
 Returns a file within the settings directory. More...
 
static File getShortcutsFile (@NotNull final CharSequence hostname, @NotNull final CharSequence character) throws IOException
 Returns the shortcuts file. More...
 

Private Member Functions

 Filenames ()
 Private constructor to prevent instantiation. More...
 

Static Private Member Functions

static String encode (@NotNull final CharSequence str)
 Encodes a string to make it safe as a file name. More...
 
static File getCrossfireFile () throws IOException
 Returns the crossfire settings directory. More...
 

Detailed Description

Utility class to return references to settings files.

Author
Andreas Kirschbaum

Definition at line 34 of file Filenames.java.

Constructor & Destructor Documentation

◆ Filenames()

com.realtime.crossfire.jxclient.settings.Filenames.Filenames ( )
private

Private constructor to prevent instantiation.

Definition at line 39 of file Filenames.java.

Member Function Documentation

◆ encode()

static String com.realtime.crossfire.jxclient.settings.Filenames.encode ( @NotNull final CharSequence  str)
staticprivate

Encodes a string to make it safe as a file name.

Parameters
strthe string to encode
Returns
the encoded string

Definition at line 189 of file Filenames.java.

References com.realtime.crossfire.jxclient.util.HexCodec.hexEncode2().

Referenced by com.realtime.crossfire.jxclient.settings.Filenames.getKeybindingsFile(), and com.realtime.crossfire.jxclient.settings.Filenames.getShortcutsFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCrossfireFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getCrossfireFile ( ) throws IOException
staticprivate

Returns the crossfire settings directory.

Returns
the settings directory
Exceptions
IOExceptionif the settings directory cannot be located

Definition at line 174 of file Filenames.java.

Referenced by com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

+ Here is the caller graph for this function:

◆ getDialogsFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getDialogsFile ( @NotNull final String  skinName) throws IOException
static

Returns the file for storing dialog related information for a skin.

Parameters
skinNameidentifies the skin
Returns
the file
Exceptions
IOExceptionif the file cannot be accessed

Definition at line 148 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.window.DialogStateParser.load(), and com.realtime.crossfire.jxclient.window.DialogStateParser.save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getKeybindingsFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getKeybindingsFile ( @Nullable final CharSequence  hostname,
@Nullable final CharSequence  character 
) throws IOException
static

Returns the keybindings file.

Parameters
hostnamethe hostname of the character;
null
=global key bindings file
characterthe character name;
null
=global key bindings file
Returns
the keybindings file; return
null
if the file cannot be accessed
Exceptions
IOExceptionif the keybindings file cannot be accessed

Definition at line 122 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.encode(), and com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient(), and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.loadPerCharacterBindings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMagicMapImageCacheDir()

static File com.realtime.crossfire.jxclient.settings.Filenames.getMagicMapImageCacheDir ( )
static

Returns the image cache directory for magic map sized images.

Returns
the image cache directory

Definition at line 77 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMessageLogFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getMessageLogFile ( @Nullable final String  hostname) throws IOException
static

Returns the log file for text message logging.

Parameters
hostnamethe server hostname or
null
Returns
the log file
Exceptions
IOExceptionif the log file cannot be determined

Definition at line 210 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.window.Logger.log().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMetaserverCacheFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getMetaserverCacheFile ( )
static

Returns the metaserver cache file.

Returns
the metaserver cache file, or
null
if the file cannot be accessed

Definition at line 132 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOriginalImageCacheDir()

static File com.realtime.crossfire.jxclient.settings.Filenames.getOriginalImageCacheDir ( )
static

Returns the image cache directory.

Returns
the image cache directory

Definition at line 47 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScaledImageCacheDir()

static File com.realtime.crossfire.jxclient.settings.Filenames.getScaledImageCacheDir ( )
static

Returns the image cache directory for double size images.

Returns
the image cache directory

Definition at line 62 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSettingsFile() [1/2]

◆ getSettingsFile() [2/2]

static File com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile ( @NotNull final String  filename) throws IOException
static

Returns a file within the settings directory.

Parameters
filenamethe filename
Returns
the settings file
Exceptions
IOExceptionif the file cannot be accessed

Definition at line 159 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.getCrossfireFile().

+ Here is the call graph for this function:

◆ getShortcutsFile()

static File com.realtime.crossfire.jxclient.settings.Filenames.getShortcutsFile ( @NotNull final CharSequence  hostname,
@NotNull final CharSequence  character 
) throws IOException
static

Returns the shortcuts file.

Parameters
hostnamethe hostname of the character;
null
=global key bindings file
characterthe character name;
null
=global key bindings file
Returns
the shortcuts file
Exceptions
IOExceptionif the file cannot be accessed

Definition at line 107 of file Filenames.java.

References com.realtime.crossfire.jxclient.settings.Filenames.encode(), and com.realtime.crossfire.jxclient.settings.Filenames.getSettingsFile().

Referenced by com.realtime.crossfire.jxclient.window.ShortcutsLoader.loadShortcuts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: