class ResourceDetailsJaxrsService {

    protected ClientResource createFileViaForm(InputStream stream, String uri, String label, String description,
            String type, Boolean createFolders, boolean dryRun) throws ErrorDescriptorException {

        if (stream == null) {
            throw new MandatoryParameterNotFoundException("data");
        }
        if (uri == null || "".equals(uri)) {
            throw new MandatoryParameterNotFoundException(PATH_PARAM_URI);
        }
        if (label == null || "".equals(label)) {
            throw new MandatoryParameterNotFoundException("label");
        }
        if (type == null || "".equals(type)) {
            throw new MandatoryParameterNotFoundException("type");
        }

        Resource createdFile = singleRepositoryService.createFileResource(stream, uri, label, label, description, type, createFolders, dryRun);
        return resourceConverterProvider.getToClientConverter(createdFile).toClient(createdFile, null);
    }

}