Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.fileaccess
Interface FileAccessService

All Known Implementing Classes:
FileAccessServiceImpl

public interface FileAccessService

A service used to provide the basic functionality required to access the underlying file system. Note: Never store unencrypted sensitive information, such as passwords, personal data, credit card numbers, etc..

Author:
Alexander Pelov

Field Summary
static String CONFPROPERTYKEY_USER_HOME
          The key of the configuration property containing the user home dir - if it is not defined the system property is used
 
Method Summary
 FailSafeTransaction createFailSafeTransaction(File file)
          Creates a failsafe transaction which can be used to safely store informations into a file.
 File getDefaultDownloadDirectory()
          Returns the default download directory depending on the operating system.
 File getPrivatePersistentDirectory(String dirName)
          This method creates a directory specific to the current user.
 File getPrivatePersistentDirectory(String[] dirNames)
          This method creates a directory specific to the current user.
 File getPrivatePersistentFile(String fileName)
          This method returns a file specific to the current user.
 File getTemporaryDirectory()
          This method returns a created temporary directory.
 File getTemporaryFile()
          This method returns a created temporary file.
 

Field Detail

CONFPROPERTYKEY_USER_HOME

static final String CONFPROPERTYKEY_USER_HOME
The key of the configuration property containing the user home dir - if it is not defined the system property is used

See Also:
Constant Field Values
Method Detail

getTemporaryFile

File getTemporaryFile()
                      throws IOException
This method returns a created temporary file. After you close this file it is not guaranteed that you will be able to open it again nor that it will contain any information. Note: DO NOT store unencrypted sensitive information in this file

Returns:
The created temporary file
Throws:
IOException - If the file cannot be created

getTemporaryDirectory

File getTemporaryDirectory()
                           throws IOException
This method returns a created temporary directory. Any file you create in it will be a temporary file. Note: If there is no opened file in this directory it may be deleted at any time. Note: DO NOT store unencrypted sensitive information in this directory

Returns:
The created directory
Throws:
IOException - If the directory cannot be created

getPrivatePersistentFile

File getPrivatePersistentFile(String fileName)
                              throws Exception
This method returns a file specific to the current user. It may not exist, but it is guaranteed that you will have the sufficient rights to create it. This file should not be considered secure because the implementor may return a file accesible to everyone. Generaly it will reside in current user's homedir, but it may as well reside in a shared directory. Note: DO NOT store unencrypted sensitive information in this file

Parameters:
fileName - The name of the private file you wish to access
Returns:
The file
Throws:
Exception - Thrown if there is no suitable location for the persistent file

getPrivatePersistentDirectory

File getPrivatePersistentDirectory(String dirName)
                                   throws Exception
This method creates a directory specific to the current user. This directory should not be considered secure because the implementor may return a directory accessible to everyone. Generally, it will reside in current user's homedir, but it may as well reside in a shared directory. It is guaranteed that you will be able to create files in it. Note: DO NOT store unencrypted sensitive information in this file

Parameters:
dirName - The name of the private directory you wish to access.
Returns:
The created directory.
Throws:
Exception - Thrown if there is no suitable location for the persistent directory.

getPrivatePersistentDirectory

File getPrivatePersistentDirectory(String[] dirNames)
                                   throws Exception
This method creates a directory specific to the current user. getPrivatePersistentDirectory(String)

Parameters:
dirNames - The name of the private directory you wish to access.
Returns:
The created directory.
Throws:
Exception - Thrown if there is no suitable location for the persistent directory.

getDefaultDownloadDirectory

File getDefaultDownloadDirectory()
                                 throws IOException
Returns the default download directory depending on the operating system.

Returns:
the default download directory depending on the operating system
Throws:
IOException - if it I/O error occurred

createFailSafeTransaction

FailSafeTransaction createFailSafeTransaction(File file)
Creates a failsafe transaction which can be used to safely store informations into a file.

Parameters:
file - The file concerned by the transaction, null if file is null.
Returns:
A new failsafe transaction related to the given file.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.