use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.
the class Serialization method save.
/**
* @param project
* @param root
* @param format
* @throws ProjectSaveException
*/
public static void save(final Project project, final Path root) throws ProjectSaveException {
Objects.requireNonNull(project);
Objects.requireNonNull(root);
try {
new YamlSerializer().serializeProjectTo(project, root);
} catch (final WriteException e) {
throw new ProjectSaveException(root, e);
}
}
use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.
the class YamlSerializer method serialize.
public void serialize(final PageCustomizations customizations) throws WriteException {
this.fileSystem = new ProjectFileSystem(customizations.getProject());
new CustomizationSerializer().serialize(customizations.getModule());
}
use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.
the class YamlSerializer method serialize.
private List<Object> serialize(final FreemarkerCatalog scripts, Function<String, Path> getPath, final boolean serializeReferencedFiles) throws WriteException {
List<Object> paths = list();
for (final FreemarkerScript script : scripts.getScripts()) {
try {
String relativePath = script.getRelativePath(scripts);
if (serializeReferencedFiles) {
final Path scriptFile = getPath.apply(relativePath);
if (!Files.exists(scriptFile.getParent()))
Files.createDirectories(scriptFile.getParent());
if (!script.isLoaded())
continue;
write(scriptFile, script);
script.setLinkedFile(scriptFile);
}
paths.add(relativePath);
} catch (final Exception e) {
throw new WriteException(script, e);
}
}
return paths;
}
use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.
the class YamlSerializer method serialize.
public void serialize(final Daemons daemons) throws WriteException {
this.fileSystem = new ProjectFileSystem(daemons.getProject());
new DaemonsSerializer().serialize(daemons);
}
use of com.developmentontheedge.be5.metadata.exception.WriteException in project be5 by DevelopmentOnTheEdge.
the class YamlSerializer method serialize.
public void serialize(final SecurityCollection security) throws WriteException {
this.fileSystem = new ProjectFileSystem(security.getProject());
new SecuritySerializer().serialize(security);
}
Aggregations