public interface Profiles extends EngineService
Modifier and Type | Method and Description |
---|---|
Profile |
defaultProfile()
Returns the default profile instance.
|
void |
delete(Profile profile)
Deletes the given
profile from the list of available profiles,
closes all browsers associated with it, releases all allocated resources and files in the
user data directory. |
java.util.List<Profile> |
list()
Returns an immutable list of the available profiles including the default profile.
|
Profile |
newIncognitoProfile(java.lang.String name)
Creates a new incognito
Profile instance with the given name . |
Profile |
newProfile(java.lang.String name)
Creates a new
Profile instance with the given name . |
engine
java.util.List<Profile> list()
java.lang.IllegalStateException
- when the engine is closed and this service is not available anymoreProfile defaultProfile()
java.lang.IllegalStateException
- when the engine is closed and this service is not available anymoreProfile newProfile(java.lang.String name)
Profile
instance with the given name
.name
- a name of the profile, cannot be empty or blankjava.lang.IllegalArgumentException
- when name
is empty or blankjava.lang.IllegalStateException
- when the engine is closed and this service is not available anymoreProfile newIncognitoProfile(java.lang.String name)
Profile
instance with the given name
.name
- a name of the profile. Cannot be empty or blankjava.lang.IllegalArgumentException
- when name
is empty or blankjava.lang.IllegalStateException
- when the engine is closed and this service is not available anymorevoid delete(Profile profile)
profile
from the list of available profiles,
closes all browsers associated with it, releases all allocated resources and files in the
user data directory.
When a profile is deleted, the cache files and preferences of the associated browsers are lost.
Does nothing if the profile is already deleted.
profile
- profile to deletejava.lang.IllegalArgumentException
- if the profile is the default profile that cannot be deletedjava.lang.IllegalStateException
- when the engine is closed and this service is not available anymoreProfile.isDefault()