use of org.springframework.roo.file.undo.CreateDirectory in project spring-roo by spring-projects.
the class DefaultFileManager method createDirectory.
public FileDetails createDirectory(final String fileIdentifier) {
if (fileMonitorService == null) {
fileMonitorService = getFileMonitorService();
}
if (filenameResolver == null) {
filenameResolver = getFileNameResolver();
}
if (undoManager == null) {
undoManager = getUndoManager();
}
Validate.notNull(fileIdentifier, "File identifier required");
Validate.notNull(fileMonitorService, "FileMonitorService required");
Validate.notNull(filenameResolver, "FilenameResolver required");
Validate.notNull(undoManager, "UndoManager required");
final File actual = new File(fileIdentifier);
Validate.isTrue(!actual.exists(), "File '%s' already exists", fileIdentifier);
try {
fileMonitorService.notifyCreated(actual.getCanonicalPath());
} catch (final IOException ignored) {
}
new CreateDirectory(undoManager, filenameResolver, actual);
return new FileDetails(actual, actual.lastModified());
}
Aggregations