@Override
	public boolean delete(ModuleDefinition definition) {
		try {
			Resource archive = getResources(definition.getType().name(), definition.getName(),
					ARCHIVE_AS_FILE_EXTENSION).iterator().next();
			if (archive instanceof WritableResource) {
				WritableResource writableResource = (WritableResource) archive;
				WritableResource hashResource = (WritableResource) hashResource(writableResource);
				// Delete hash first
				ExtendedResource.wrap(hashResource).delete();
				return ExtendedResource.wrap(writableResource).delete();
			}
			else {
				return false;
			}
		}
		catch (IOException e) {
			throw new RuntimeIOException("Exception while trying to delete module " + definition, e);
		}

	}
Whether to attempt to create the directory structure at startup (disable for read-only implementations).
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/module/WritableResourceModuleRegistry.java