public class UserDetailsResourceFactoryBean extends java.lang.Object implements org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.FactoryBean<java.util.Collection<UserDetails>>
username=password[,enabled|disabled],roles...
The enabled and disabled properties are optional with enabled being the default. For example:
user=password,ROLE_USER
admin=secret,ROLE_USER,ROLE_ADMIN
disabled_user=does_not_matter,disabled,ROLE_USER
Constructor and Description |
---|
UserDetailsResourceFactoryBean() |
Modifier and Type | Method and Description |
---|---|
static UserDetailsResourceFactoryBean |
fromResource(org.springframework.core.io.Resource propertiesResource)
Create a UserDetailsResourceFactoryBean with a Resource that is a Properties file in the
format defined in
UserDetailsResourceFactoryBean |
static UserDetailsResourceFactoryBean |
fromResourceLocation(java.lang.String resourceLocatiton)
Create a UserDetailsResourceFactoryBean with the location of a Resource that is a Properties file in the
format defined in
UserDetailsResourceFactoryBean |
java.util.Collection<UserDetails> |
getObject() |
java.lang.Class<?> |
getObjectType() |
void |
setResource(org.springframework.core.io.Resource resource)
Sets a a Resource that is a Properties file in the format defined in
UserDetailsResourceFactoryBean |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setResourceLocation(java.lang.String resourceLocation)
Sets a the location of a Resource that is a Properties file in the format defined in
UserDetailsResourceFactoryBean |
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public java.util.Collection<UserDetails> getObject() throws java.lang.Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<java.util.Collection<UserDetails>>
java.lang.Exception
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<java.util.Collection<UserDetails>>
public void setResourceLocation(java.lang.String resourceLocation)
UserDetailsResourceFactoryBean
resourceLocation
- the location of the properties file that contains the users (i.e. "classpath:users.properties")public void setResource(org.springframework.core.io.Resource resource)
UserDetailsResourceFactoryBean
resource
- the Resource to usepublic static UserDetailsResourceFactoryBean fromResourceLocation(java.lang.String resourceLocatiton)
UserDetailsResourceFactoryBean
resourceLocatiton
- the location of the properties file that contains the users (i.e. "classpath:users.properties")public static UserDetailsResourceFactoryBean fromResource(org.springframework.core.io.Resource propertiesResource)
UserDetailsResourceFactoryBean
propertiesResource
- the Resource that is a properties file that contains the users