Check system properties for name of destination directory

cusax-fix
Emil Ivov 20 years ago
parent 6f991b2796
commit cfda73e10f

@ -15,7 +15,7 @@
/**
* Default FileAccessService implementation.
*
*
* @author Alexander Pelov
*/
public class FileAccessServiceImpl implements FileAccessService {
@ -43,14 +43,14 @@ public class FileAccessServiceImpl implements FileAccessService {
/**
* An synchronization object.
*
*
* A lock should be obtained whenever the configuration service is accessed.
*/
private Object syncRoot = new Object();
/**
* Set the configuration service.
*
*
* @param configurationService
*/
public void setConfigurationService(
@ -63,7 +63,7 @@ public void setConfigurationService(
/**
* Remove a configuration service.
*
*
* @param configurationService
*/
public void unsetConfigurationService(
@ -189,6 +189,9 @@ private String getFullPath(String fileName) {
.getString(FileAccessService.CONFPROPERTYKEY_USER_HOME);
sipSubdir = this.configurationService
.getString(FileAccessService.CONFPROPERTYKEY_SIPCOMM_DIRECTORY);
if(sipSubdir == null)
sipSubdir = System.getProperty(
FileAccessService.CONFPROPERTYKEY_SIPCOMM_DIRECTORY);
}
if (userhome == null) {
@ -216,10 +219,10 @@ private String getFullPath(String fileName) {
/**
* Checks if a file exists and if it is writable or readable. If not -
* checks if the user has a write privileges to the containing directory.
*
*
* If those conditions are met it returns a File in the directory with a
* fileName. If not - returns null.
*
*
* @param homedir
* @param fileName
* @return Returns null if the file does not exist and cannot be created.

@ -12,10 +12,10 @@
/**
* A service used to provide the basic functionality required to access the
* undelying file system.
*
*
* Note: Never store unencrypted sensitive information, such as passwords,
* personal data, credit card numbers, etc..
*
*
* @author Alexander Pelov
*/
public interface FileAccessService {
@ -29,12 +29,12 @@ public interface FileAccessService {
* The key of the configuration property containing the user home dir - if
* it is not defined the system property is used
*/
public static final String CONFPROPERTYKEY_USER_HOME = "net.java.sip.communicator.user.home";
public static final String CONFPROPERTYKEY_USER_HOME = "net.java.sip.communicator.fileaccess.USER_HOME";
/**
* The subdirectory of USER_HOME in which all user files will be stored
*/
public static final String CONFPROPERTYKEY_SIPCOMM_DIRECTORY = "net.java.sip.communicator.user.home.sip-communicator-home";
public static final String CONFPROPERTYKEY_SIPCOMM_DIRECTORY = "net.java.sip.communicator.fileaccess.SIP_COMMUNICATOR_HOME";
/**
* The default subdirectory
@ -45,9 +45,9 @@ public interface FileAccessService {
* 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
*
*
* @return The created temporary file
* @throws IOException
* If the file cannot be created
@ -57,11 +57,11 @@ public interface FileAccessService {
/**
* 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
*
*
* @return The created directory
* @throws IOException
* If the directory cannot be created
@ -72,13 +72,13 @@ public interface FileAccessService {
* 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
*
*
* @param fileName
* The name of the private file you wish to access
* @return The file
@ -90,15 +90,15 @@ public interface FileAccessService {
/**
* This method creates a directory specific to the current user.
*
*
* This directory should not be considered secure because the implementor
* may return a directory accesible to everyone. Generaly 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
*
*
* @param dirName
* The name of the private directory you wish to access.
* @return The created directory.
@ -110,9 +110,9 @@ public interface FileAccessService {
/**
* This method creates a directory specific to the current user.
*
*
* {@link #getPrivatePersistentDirectory(String)}
*
*
* @param dirNames
* The name of the private directory you wish to access.
* @return The created directory.

Loading…
Cancel
Save