Default avatar folder now is a sub-folder of the `user.home` directory if the `jboss.server.data.dir` property is not set (or the runtime env. is not JBoss/WildFly)

This commit is contained in:
Mauro Mugnaini 2022-02-18 16:38:28 +01:00
parent 6dc1fb4c6b
commit 26fc964947
1 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,12 @@ import org.keycloak.models.KeycloakSessionFactory;
public class FileAvatarStorageProviderFactory implements AvatarStorageProviderFactory { public class FileAvatarStorageProviderFactory implements AvatarStorageProviderFactory {
public static final String DEFAULT_AVATAR_FOLDER = System.getProperty("jboss.server.data.dir") + "/avatar"; public static final String DEFAULT_AVATAR_FOLDER = (
System.getProperty("jboss.server.data.dir") != null
? System.getProperty("jboss.server.data.dir")
: System.getProperty("user.home")
) + "/avatar";
public static final Boolean USE_EMAIL_AS_FILENAME_DEFAULT = Boolean.FALSE; public static final Boolean USE_EMAIL_AS_FILENAME_DEFAULT = Boolean.FALSE;
private String avatarFolder; private String avatarFolder;