public.javadoc.org.spincast.plugins.routing.StaticResourceBuilder.html Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of spincast-website Show documentation
                Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
                
            
StaticResourceBuilder (org.spincast:spincast-framework 0.9.21 API) 
org.spincast.plugins.routing
Class StaticResourceBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
- java.lang.Object
 
- 
- org.spincast.plugins.routing.StaticResourceBuilder<R,W>
 
 
- 
- All Implemented Interfaces:
 
- IStaticResourceBuilder<R>
 
public class StaticResourceBuilder<R extends IRequestContext<?>,W extends IWebsocketContext<?>>
extends Object
implements IStaticResourceBuilder<R>
 
- 
- 
Constructor Summary
Constructors  
Constructor and Description 
 
StaticResourceBuilder(boolean isDir,
                     IStaticResourceFactory<R> staticResourceFactory,
                     IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)  
 
StaticResourceBuilder(IRouter<R,W> router,
                     boolean isDir,
                     IStaticResourceFactory<R> staticResourceFactory,
                     IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)  
 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods  
Modifier and Type 
Method and Description 
 
IStaticResourceBuilder<R> 
classpath(String path)
The path to the resource, on the classpath.
 
 
IStaticResourceBuilder<R> 
cors()
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResourceBuilder<R> 
cors(Set<String> allowedOrigins)
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResourceBuilder<R> 
cors(Set<String> allowedOrigins,
    Set<String> extraHeadersAllowedToBeRead)
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResourceBuilder<R> 
cors(Set<String> allowedOrigins,
    Set<String> extraHeadersAllowedToBeRead,
    Set<String> extraHeadersAllowedToBeSent)
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResourceBuilder<R> 
cors(Set<String> allowedOrigins,
    Set<String> extraHeadersAllowedToBeRead,
    Set<String> extraHeadersAllowedToBeSent,
    boolean allowCookies)
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResourceBuilder<R> 
cors(Set<String> allowedOrigins,
    Set<String> extraHeadersAllowedToBeRead,
    Set<String> extraHeadersAllowedToBeSent,
    boolean allowCookies,
    int maxAgeInSeconds)
Enables Cross-Origin Resource Sharing (Cors)
 
 
IStaticResource<R> 
create()
Creates and returns the static resource without adding it to
 the router.
 
 
IStaticResourceBuilder<R> 
fileSystem(String path)
The path to the resource, on the file system.
 
 
IStaticResourceCorsConfig 
getCorsConfig()  
 
protected Set<String> 
getCorsDefaultAllowedOrigins()
The origins allowed, by default.
 
 
protected Set<String> 
getCorsDefaultExtraHeadersAllowedToBeRead()
The extra headers allowed to be read, by default,
 
 
protected Set<String> 
getCorsDefaultExtraHeadersAllowedToBeSent()
The extra headers allowed to be sent, by default,
 
 
protected boolean 
getCorsDefaultIsCookiesAllowed()
Are cookies allowed by default?
 
 
protected int 
getCorsDefaultMaxAgeInSeconds()
If <= 0, the "Access-Control-Max-Age" header
 won't be sent.
 
 
IHandler<R> 
getGenerator()  
 
String 
getPath()  
 
protected IRouter<R,W> 
getRouter()  
 
protected IStaticResourceCorsConfigFactory 
getStaticResourceCorsConfigFactory()  
 
protected IStaticResourceFactory<R> 
getStaticResourceFactory()  
 
String 
getUrl()  
 
boolean 
isClasspath()  
 
protected boolean 
isDir()  
 
void 
save()
Saves the static resource route to the router.
 
 
void 
save(IHandler<R> generator)
Saves the static resource route.
 
 
IStaticResourceBuilder<R> 
url(String url)
The URL pointing to the resource.
 
 
 
 
- 
- 
Constructor Detail
- 
StaticResourceBuilder
public StaticResourceBuilder(boolean isDir,
                             IStaticResourceFactory<R> staticResourceFactory,
                             IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)
 
- 
StaticResourceBuilder
public StaticResourceBuilder(IRouter<R,W> router,
                             boolean isDir,
                             IStaticResourceFactory<R> staticResourceFactory,
                             IStaticResourceCorsConfigFactory staticResourceCorsConfigFactory)
 
 
- 
Method Detail
- 
isDir
protected boolean isDir()
 
- 
getStaticResourceFactory
protected IStaticResourceFactory<R> getStaticResourceFactory()
 
- 
getStaticResourceCorsConfigFactory
protected IStaticResourceCorsConfigFactory getStaticResourceCorsConfigFactory()
 
- 
getUrl
public String getUrl()
 
- 
getPath
public String getPath()
 
- 
isClasspath
public boolean isClasspath()
 
- 
getCorsConfig
public IStaticResourceCorsConfig getCorsConfig()
 
- 
url
public IStaticResourceBuilder<R> url(String url)
Description copied from interface: IStaticResourceBuilder
The URL pointing to the resource.
- Specified by:
 
url in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
 
- 
classpath
public IStaticResourceBuilder<R> classpath(String path)
Description copied from interface: IStaticResourceBuilder
The path to the resource, on the classpath.
- Specified by:
 
classpath in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
 
- 
fileSystem
public IStaticResourceBuilder<R> fileSystem(String path)
Description copied from interface: IStaticResourceBuilder
The path to the resource, on the file system.
- Specified by:
 
fileSystem in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
 
- 
cors
public IStaticResourceBuilder<R> cors()
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context) 
 
- 
cors
public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins)
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context, 
                                          Set<String> allowedOrigins) 
 
- 
cors
public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins,
                                      Set<String> extraHeadersAllowedToBeRead)
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context, 
                                          Set<String> allowedOrigins,
                                          Set<String> extraHeadersAllowedToBeRead) 
 
- 
cors
public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins,
                                      Set<String> extraHeadersAllowedToBeRead,
                                      Set<String> extraHeadersAllowedToBeSent)
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context, 
                                          Set<String> allowedOrigins,
                                          Set<String> extraHeadersAllowedToBeRead,
                                          Set<String> extraHeadersAllowedToBeSent) 
 
- 
cors
public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins,
                                      Set<String> extraHeadersAllowedToBeRead,
                                      Set<String> extraHeadersAllowedToBeSent,
                                      boolean allowCookies)
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context, 
                                          Set<String> allowedOrigins,
                                          Set<String> extraHeadersAllowedToBeRead,
                                          Set<String> extraHeadersAllowedToBeSent,
                                          boolean allowCookies) 
 
- 
cors
public IStaticResourceBuilder<R> cors(Set<String> allowedOrigins,
                                      Set<String> extraHeadersAllowedToBeRead,
                                      Set<String> extraHeadersAllowedToBeSent,
                                      boolean allowCookies,
                                      int maxAgeInSeconds)
Description copied from interface: IStaticResourceBuilder
Enables Cross-Origin Resource Sharing (Cors)
- Specified by:
 
cors in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- See Also:
 
ISpincastFilters#cors(R context, 
                                          Set<String> allowedOrigins,
                                          Set<String> extraHeadersAllowedToBeRead,
                                          Set<String> extraHeadersAllowedToBeSent,
                                          boolean allowCookies,
                                          int maxAgeInSeconds
                                          ) 
 
- 
save
public void save()
Description copied from interface: IStaticResourceBuilder
Saves the static resource route to the router.
 
 If the creation of the resource was not started using
 an IRouter object, an exception will be
 thrown.
- Specified by:
 
save in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
 
- 
save
public void save(IHandler<R> generator)
Description copied from interface: IStaticResourceBuilder
Saves the static resource route.
 
 If the creation of the resource was not started using
 an IRouter object, an exception will be
 thrown.
- Specified by:
 
save in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
- Parameters:
 
generator - If the resource is not found, the specified
 generator will be used to generate it and
 the result will be saved. 
 
- 
create
public IStaticResource<R> create()
Description copied from interface: IStaticResourceBuilder
Creates and returns the static resource without adding it to
 the router.
 
 NOTE : use save(...) instead to save the static resource 
 to the router at the end of the build process!
- Specified by:
 
create in interface IStaticResourceBuilder<R extends IRequestContext<?>> 
 
- 
getCorsDefaultMaxAgeInSeconds
protected int getCorsDefaultMaxAgeInSeconds()
If <= 0, the "Access-Control-Max-Age" header
 won't be sent.
 
- 
getCorsDefaultAllowedOrigins
protected Set<String> getCorsDefaultAllowedOrigins()
The origins allowed, by default.
 
- 
getCorsDefaultExtraHeadersAllowedToBeRead
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeRead()
The extra headers allowed to be read, by default,
 
- 
getCorsDefaultExtraHeadersAllowedToBeSent
protected Set<String> getCorsDefaultExtraHeadersAllowedToBeSent()
The extra headers allowed to be sent, by default,
 
- 
getCorsDefaultIsCookiesAllowed
protected boolean getCorsDefaultIsCookiesAllowed()
Are cookies allowed by default?
 
 
 
Copyright © 2016. All rights reserved.
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy