
org.sevensource.magnolia.backup.support.SimpleBackupUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magnolia-module-simple-backup Show documentation
Show all versions of magnolia-module-simple-backup Show documentation
Magnolia CMS module for backup and restore
The newest version!
package org.sevensource.magnolia.backup.support;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class SimpleBackupUtils {
private static final Logger logger = LoggerFactory.getLogger(SimpleBackupUtils.class);
private SimpleBackupUtils() {}
public static Path createDirectory(Path path) {
if(path.toFile().exists()) {
throw new IllegalArgumentException("Directory " + path.toString() + " already exists");
}
try {
return Files.createDirectory(path);
} catch (IOException e) {
throw new IllegalArgumentException("Cannot create directory", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy