Package com.vaadin.flow.server
Interface AbstractConfiguration
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ApplicationConfiguration
,DeploymentConfiguration
- All Known Implementing Classes:
AbstractDeploymentConfiguration
,AbstractPropertyConfiguration
,DefaultApplicationConfigurationFactory.ApplicationConfigurationImpl
,DefaultDeploymentConfiguration
,PropertyDeploymentConfiguration
Defines a base contract for configuration (e.g. on an application level,
servlet level,...).
- Since:
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Deprecated.boolean
getBooleanProperty
(String name, boolean defaultValue) Gets a configured property as a boolean.default String
Return the defined build folder for the used build system.default File
Gets the folder where resource sources are stored.default File
Gets the folder where sources are stored.default Mode
getMode()
Gets the mode the application is running in.default File
Return the project root folder.getStringProperty
(String name, String defaultValue) Gets a configured property as a string.default boolean
Returns whether bun is enabled or not.default boolean
Returns whether globally installed pnpm is used or the default one (seeFrontendTools.DEFAULT_PNPM_VERSION
).default boolean
Returns whether pnpm is enabled or not.boolean
Returns whether Vaadin is in production mode.default boolean
Returns whether development time usage statistics collection is enabled or not.default boolean
Returns whether cross-site request forgery protection is enabled.default boolean
Get if the dev server should be reused on each reload.
-
Method Details
-
isProductionMode
boolean isProductionMode()Returns whether Vaadin is in production mode.- Returns:
- true if in production mode, false otherwise.
-
frontendHotdeploy
Deprecated.UsegetMode()
insteadGet if the dev server should be enabled. false by default as a development bundle is used.- Returns:
- true if dev server should be used
-
getMode
Gets the mode the application is running in.- Returns:
- custom production bundle, pre-compiled production bundle, development using livereload or development using bundle
-
reuseDevServer
default boolean reuseDevServer()Get if the dev server should be reused on each reload. True by default, set it to false in tests so as dev server is not kept as a daemon after the test.- Returns:
- true if dev server should be reused
-
getStringProperty
Gets a configured property as a string.- Parameters:
name
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been defined- Returns:
- the property value, or the passed default value if no property value is found
-
getBooleanProperty
Gets a configured property as a boolean.- Parameters:
name
- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue
- the default value that should be used if no value has been defined- Returns:
- the property value, or the passed default value if no property value is found
-
isPnpmEnabled
default boolean isPnpmEnabled()Returns whether pnpm is enabled or not.- Returns:
true
if enabled,false
if not
-
isBunEnabled
default boolean isBunEnabled()Returns whether bun is enabled or not.- Returns:
true
if enabled,false
if not
-
isGlobalPnpm
default boolean isGlobalPnpm()Returns whether globally installed pnpm is used or the default one (seeFrontendTools.DEFAULT_PNPM_VERSION
).- Returns:
true
if globally installed pnpm is used,false
if the default one is used.
-
isUsageStatisticsEnabled
default boolean isUsageStatisticsEnabled()Returns whether development time usage statistics collection is enabled or not. Always return false ifisProductionMode
istrue
.- Returns:
true
if enabled,false
if not collected.- See Also:
-
isXsrfProtectionEnabled
default boolean isXsrfProtectionEnabled()Returns whether cross-site request forgery protection is enabled.- Returns:
- true if XSRF protection is enabled, false otherwise.
-
getBuildFolder
Return the defined build folder for the used build system.Default value is
target
used by maven and the gradle plugin will set it tobuild
.- Returns:
- build folder name, default
target
-
getProjectFolder
Return the project root folder.Only available in development mode.
- Returns:
- the project root folder, or
null
if unknown
-
getJavaResourceFolder
Gets the folder where resource sources are stored.Only available in development mode.
- Returns:
- the folder where resources are stored, typically
src/main/resources
.
-
getJavaSourceFolder
Gets the folder where sources are stored.Only available in development mode.
- Returns:
- the folder where source files are stored, typically
src/main/java
.
-
getMode()
instead