class NewFileUploader extends DefaultNewResourceHandler {

    @Override
    public void create(final org.guvnor.common.services.project.model.Package pkg,
                       final String baseFileName,
                       final NewResourcePresenter presenter) {

        //See https://bugzilla.redhat.com/show_bug.cgi?id=1091204
        //If the User-provided file name has an extension use that; otherwise use the same extension as the original (OS FileSystem) extension
        String targetFileName;
        String extension;
        final String originalFileName = options.getFormFileName();
        final String providedFileName = baseFileName;

        if (originalFileName == null || "".equals(originalFileName)) {
            Window.alert(CommonConstants.INSTANCE.UploadSelectAFile());
            return;
        }

        if (providedFileName.contains(".")) {
            targetFileName = providedFileName;
            extension = getExtension(providedFileName);
        } else {
            extension = getExtension(originalFileName);
            targetFileName = providedFileName + "." + extension;
        }

        busyIndicatorView.showBusyIndicator(GuvnorDefaultEditorConstants.INSTANCE.Uploading());

        moduleService.call(getResolvePathSuccessCallback(targetFileName, presenter),
                            new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)).resolveDefaultPath(pkg, extension);
    }

    public  NewFileUploader();
    @Inject public  NewFileUploader(final PlaceManager placeManager,
                           final DefaultEditorNewFileUpload options,
                           final AnyResourceTypeDefinition resourceType,
                           final BusyIndicatorView busyIndicatorView,
                           final Caller<KieModuleService> moduleService);

}