@Override public Plugin createNewPlugin(final String pluginName, final PluginType type) { checkNotEmpty("pluginName", pluginName); checkCondition("valid plugin name", defaultFileNameValidator.isValid(pluginName)); final Path pluginRoot = getPluginPath(pluginName); if (getIoService().exists(pluginRoot)) { throw new PluginAlreadyExists(); } final Path pluginPath = pluginRoot.resolve(type.toString().toLowerCase() + ".plugin"); final Plugin plugin = new Plugin(pluginName, type, convert(pluginPath)); updatePlugin(pluginPath, plugin, true); return plugin; }