class KModuleServiceImpl implements KModuleService {

    @Override
    public Path setUpKModule(final Path path) {
        try {
            final org.uberfire.java.nio.file.Path pathToKModuleXML = Paths.convert(path);
            if (ioService.exists(pathToKModuleXML)) {
                throw new FileAlreadyExistsException(pathToKModuleXML.toString());
            } else {
                ioService.write(pathToKModuleXML,
                                moduleContentHandler.toString(new KModuleModel()));

                //Don't raise a NewResourceAdded event as this is handled at the Module level in ModuleServices

                return Paths.convert(pathToKModuleXML);
            }
        } catch (Exception e) {
            throw ExceptionUtilities.handleException(e);
        }
    }

    public  KModuleServiceImpl();
    @Inject public  KModuleServiceImpl(final @Named("ioStrategy") IOService ioService,
                              final KieModuleService moduleService,
                              final MetadataService metadataService,
                              final KModuleContentHandler moduleContentHandler);

}