public final class Cdn extends Object
configure() method or you can take a look at predefined instances in CdnFactory.| Modifier and Type | Method and Description |
|---|---|
static CdnSettings |
configure()
Build custom CDN instance.
|
CdnSettings |
getSettings()
Get settings used by this CDN instance
|
Configuration |
load(File file)
Load configuration located in the given file with UTF-8 charset.
|
Configuration |
load(File file,
Charset charset)
Load configuration located in the given file with the provided charset.
|
<T> T |
load(File file,
Charset charset,
Class<T> configurationClass)
Load configuration located in the given file as the given class using the given charset
|
<T> T |
load(File file,
Class<T> configurationClass)
Load configuration located in the given file as the given class using UTF-8 charset.
|
Configuration |
load(Path file)
Load configuration located in the given file with UTF-8 charset.
|
Configuration |
load(Path file,
Charset charset)
Load configuration located in the given file with the provided charset.
|
<T> T |
load(Path file,
Charset charset,
Class<T> configurationClass)
Load configuration located in the given file as the given class using the given charset
|
<T> T |
load(Path file,
Class<T> configurationClass)
Load configuration located in the given file as the given class using UTF-8 charset.
|
Configuration |
load(String source)
Load configuration as default
Configuration structure. |
<T> T |
load(String source,
Class<T> configurationClass)
Load configuration from the given source and map default
Configuration structure into the given configuration class. |
<T> T |
load(String source,
T instance)
Load configuration from the given source and map default
Configuration structure into the given configuration class. |
String |
render(Element<?> element)
Convert the given configuration instance to the output string
|
void |
render(Element<?> element,
File output)
Convert the given instance using
render(net.dzikoysk.cdn.model.Element) method and save the output in the given file using UTF-8 charset. |
void |
render(Element<?> element,
Path output)
Convert the given instance using
render(net.dzikoysk.cdn.model.Element) method and save the output in the given file using UTF-8 charset. |
String |
render(Object entity)
Convert the given instance to the output string
|
void |
render(Object entity,
File output)
Convert the given instance using
render(Object) method and save the output in the given file using UTF-8 charset. |
void |
render(Object entity,
Path output)
Convert the given instance using
render(Object) method and save the output in the given file using UTF-8 charset. |
public static CdnSettings configure()
CdnFactory class.CdnFactorypublic Configuration load(String source)
Configuration structure.source - the source to loadpublic Configuration load(File file) throws IOException
load(java.io.File, java.nio.charset.Charset).file - the file to loadIOException - in case of any IO related errorpublic Configuration load(Path file) throws IOException
load(java.io.File, java.nio.charset.Charset).file - the file to loadIOException - in case of any IO related errorpublic Configuration load(File file, Charset charset) throws IOException
file - the file to loadcharset - the charset to useIOException - in case of any IO related errorpublic Configuration load(Path file, Charset charset) throws IOException
file - the file to loadcharset - the charset to useIOException - in case of any IO related errorpublic <T> T load(String source, Class<T> configurationClass) throws Exception
Configuration structure into the given configuration class.T - the expected typesource - the source to loadconfigurationClass - the class to useConfiguration structureException - in case of any deserialization errorpublic <T> T load(String source, T instance) throws Exception
Configuration structure into the given configuration class.T - the expected typesource - the source to loadinstance - the instance to useConfiguration structureException - in case of any deserialization errorpublic <T> T load(File file, Class<T> configurationClass) throws Exception
load(java.io.File, java.nio.charset.Charset, Class)T - the expected typefile - the file to loadconfigurationClass - the class to useException - in case of any deserialization/IO errorpublic <T> T load(Path file, Class<T> configurationClass) throws Exception
load(java.io.File, java.nio.charset.Charset, Class)T - the expected typefile - the file to loadconfigurationClass - the class to useException - in case of any deserialization/IO errorpublic <T> T load(File file, Charset charset, Class<T> configurationClass) throws Exception
T - the expected typefile - the file to loadconfigurationClass - the class to useException - in case of any deserialization/IO errorpublic <T> T load(Path file, Charset charset, Class<T> configurationClass) throws Exception
T - the expected typefile - the file to loadconfigurationClass - the class to useException - in case of any deserialization/IO errorpublic String render(Object entity)
entity - the instance to convertpublic void render(Object entity, File output) throws IOException
render(Object) method and save the output in the given file using UTF-8 charset.entity - the instance to convertoutput - the output fileIOExceptionpublic void render(Object entity, Path output) throws IOException
render(Object) method and save the output in the given file using UTF-8 charset.entity - the instance to convertoutput - the output fileIOExceptionpublic String render(Element<?> element)
element - the element to convertpublic void render(Element<?> element, File output) throws IOException
render(net.dzikoysk.cdn.model.Element) method and save the output in the given file using UTF-8 charset.element - the element to convertoutput - the output fileIOExceptionpublic void render(Element<?> element, Path output) throws IOException
render(net.dzikoysk.cdn.model.Element) method and save the output in the given file using UTF-8 charset.element - the element to convertoutput - the output fileIOExceptionpublic CdnSettings getSettings()
Copyright © 2021. All rights reserved.