class DataModelerServiceHelper {

    public String calculateClassName(final Module module,
                                     final org.uberfire.backend.vfs.Path path) {
        PortablePreconditions.checkNotNull("module", module);
        if (path == null) {
            return null;
        }
        final Package defaultPackage = moduleService.resolveDefaultPackage(module);
        if (defaultPackage == null) {
            return null;
        }
        final Path mainSrcNioPath = Paths.convert(defaultPackage.getPackageMainSrcPath());
        final Path testSrcNioPath = Paths.convert(defaultPackage.getPackageTestSrcPath());
        final Path nioPath = Paths.convert(path);
        Path relativePath = null;

        if (mainSrcNioPath != null && nioPath.startsWith(mainSrcNioPath)) {
            relativePath = mainSrcNioPath.relativize(nioPath);
        } else if (testSrcNioPath != null && nioPath.startsWith(testSrcNioPath)) {
            relativePath = testSrcNioPath.relativize(nioPath);
        }

        if (relativePath != null) {
            String className = relativePath.toString().replace("/", ".");
            return className.substring(0, className.lastIndexOf(".java"));
        }
        return null;
    }

    public  DataModelerServiceHelper();
    @Inject public  DataModelerServiceHelper(final KieModuleService moduleService,
                                    final @Named("ioStrategy") IOService ioService,
                                    final CommentedOptionFactory commentedOptionFactory);

}