Search in sources :

Example 1 with DumpMetaJsonSerializer

use of com.enonic.xp.repo.impl.dump.serializer.json.DumpMetaJsonSerializer in project xp by enonic.

the class RepositoryIdDumpUpgrader method upgradeDumpMetaFile.

private void upgradeDumpMetaFile() {
    final DumpMeta sourceDumpMeta = dumpReader.getDumpMeta();
    final DumpMeta upgradedDumpMeta = DumpMeta.create(sourceDumpMeta).systemDumpResult(upgradeSystemDumpResult(sourceDumpMeta.getSystemDumpResult())).build();
    final Path dumpMetaFile = dumpReader.getMetaDataFile();
    try {
        Files.write(dumpMetaFile, new DumpMetaJsonSerializer().serialize(upgradedDumpMeta));
    } catch (IOException e) {
        throw new DumpUpgradeException("Unable to upgrade dump meta file: " + dumpMetaFile.getFileName(), e);
    }
}
Also used : Path(java.nio.file.Path) DumpMetaJsonSerializer(com.enonic.xp.repo.impl.dump.serializer.json.DumpMetaJsonSerializer) DumpMeta(com.enonic.xp.repo.impl.dump.model.DumpMeta) IOException(java.io.IOException)

Aggregations

DumpMeta (com.enonic.xp.repo.impl.dump.model.DumpMeta)1 DumpMetaJsonSerializer (com.enonic.xp.repo.impl.dump.serializer.json.DumpMetaJsonSerializer)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1