Source:
<code>public Object convert(@FormParam("converter") String converter, @FormParam("type") String type, @FormParam("format") String format, @FormParam("async") boolean async, @Context UriInfo uriInfo) { if (!async) { return convert(converter, type, format, uriInfo); } String conversionId; BlobHolder bh = getBlobHolderToConvert(); Map<String, Serializable> parameters = computeConversionParameters(uriInfo); ConversionService conversionService = Framework.getService(ConversionService.class); if (StringUtils.isNotBlank(converter)) { conversionId = conversionService.scheduleConversion(converter, bh, parameters); } else if (StringUtils.isNotBlank(type)) { conversionId = conversionService.scheduleConversionToMimeType(type, bh, parameters); } else if (StringUtils.isNotBlank(format)) { MimetypeRegistry mimetypeRegistry = Framework.getService(MimetypeRegistry.class); String mimeType = mimetypeRegistry.getMimetypeFromExtension(format); conversionId = conversionService.scheduleConversionToMimeType(mimeType, bh, parameters); } else { throw new IllegalParameterException("No converter, type or format parameter specified"); } <START> String serverURL = ctx.getServerURL().toString().replaceAll("/$", ""); <END> String pollingURL = String.format("%s%s/conversions/%s/poll", serverURL, ctx.getModulePath(), conversionId); String resultURL = String.format("%s%s/conversions/%s/result", serverURL, ctx.getModulePath(), conversionId); ConversionScheduled conversionScheduled = new ConversionScheduled(conversionId, pollingURL, resultURL); try { return Response.status(Response.Status.ACCEPTED) .location(new URI(pollingURL)) .entity(conversionScheduled) .build(); } catch (URISyntaxException e) { throw new NuxeoException(e); } }</code><technical_language>StringUtils.stripEnd instead maybe</technical_language>

Target:
public Object convert(@FormParam("converter") String converter, @FormParam("type") String type, @FormParam("format") String format, @FormParam("async") boolean async, @Context UriInfo uriInfo) { if (!async) { return convert(converter, type, format, uriInfo); } String conversionId; BlobHolder bh = getBlobHolderToConvert(); Map<String, Serializable> parameters = computeConversionParameters(uriInfo); ConversionService conversionService = Framework.getService(ConversionService.class); if (StringUtils.isNotBlank(converter)) { conversionId = conversionService.scheduleConversion(converter, bh, parameters); } else if (StringUtils.isNotBlank(type)) { conversionId = conversionService.scheduleConversionToMimeType(type, bh, parameters); } else if (StringUtils.isNotBlank(format)) { MimetypeRegistry mimetypeRegistry = Framework.getService(MimetypeRegistry.class); String mimeType = mimetypeRegistry.getMimetypeFromExtension(format); conversionId = conversionService.scheduleConversionToMimeType(mimeType, bh, parameters); } else { throw new IllegalParameterException("No converter, type or format parameter specified"); } String serverURL = StringUtils.stripEnd(ctx.getServerURL().toString(), "/"); String pollingURL = String.format("%s%s/conversions/%s/poll", serverURL, ctx.getModulePath(), conversionId); String resultURL = String.format("%s%s/conversions/%s/result", serverURL, ctx.getModulePath(), conversionId); ConversionScheduled conversionScheduled = new ConversionScheduled(conversionId, pollingURL, resultURL); try { return Response.status(Response.Status.ACCEPTED) .location(new URI(pollingURL)) .entity(conversionScheduled) .build(); } catch (URISyntaxException e) { throw new NuxeoException(e); } }