@Test void testBuildImageServiceContext() { final Config config = new Config(); config.setIsUBLImageService(true); config.setViewId("12345"); config.setImageServiceBaseUrl("https: config.setImageServiceImageDirPrefix("/j2k/"); final IRIBuilder iriBuilder = new IRIBuilder(config); final String imageServiceContext = iriBuilder.buildImageServiceContext("12345"); assertEquals("https: }
public String buildImageServiceContext(final String viewId) { final int viewIdInt = parseInt(viewId); final String v = format("%010d", viewIdInt); final String imageDirPrefix = config.getImageServiceImageDirPrefix(); final int part1 = parseInt(v.substring(0,4)); final String first = format("%04d", part1); final int part2 = parseInt(v.substring(5,8)); final String second = format("%04d", part2); if (config.getIsUBLImageService()) { return config.getImageServiceBaseUrl() + imageDirPrefix + first + separator + second + separator + v; } else { return config.getImageServiceBaseUrl() + viewId; } }
IRIBuilder { public String buildImageServiceContext(final String viewId) { final int viewIdInt = parseInt(viewId); final String v = format("%010d", viewIdInt); final String imageDirPrefix = config.getImageServiceImageDirPrefix(); final int part1 = parseInt(v.substring(0,4)); final String first = format("%04d", part1); final int part2 = parseInt(v.substring(5,8)); final String second = format("%04d", part2); if (config.getIsUBLImageService()) { return config.getImageServiceBaseUrl() + imageDirPrefix + first + separator + second + separator + v; } else { return config.getImageServiceBaseUrl() + viewId; } } }
IRIBuilder { public String buildImageServiceContext(final String viewId) { final int viewIdInt = parseInt(viewId); final String v = format("%010d", viewIdInt); final String imageDirPrefix = config.getImageServiceImageDirPrefix(); final int part1 = parseInt(v.substring(0,4)); final String first = format("%04d", part1); final int part2 = parseInt(v.substring(5,8)); final String second = format("%04d", part2); if (config.getIsUBLImageService()) { return config.getImageServiceBaseUrl() + imageDirPrefix + first + separator + second + separator + v; } else { return config.getImageServiceBaseUrl() + viewId; } } IRIBuilder(final Config config); private  IRIBuilder(); }
IRIBuilder { public String buildImageServiceContext(final String viewId) { final int viewIdInt = parseInt(viewId); final String v = format("%010d", viewIdInt); final String imageDirPrefix = config.getImageServiceImageDirPrefix(); final int part1 = parseInt(v.substring(0,4)); final String first = format("%04d", part1); final int part2 = parseInt(v.substring(5,8)); final String second = format("%04d", part2); if (config.getIsUBLImageService()) { return config.getImageServiceBaseUrl() + imageDirPrefix + first + separator + second + separator + v; } else { return config.getImageServiceBaseUrl() + viewId; } } IRIBuilder(final Config config); private  IRIBuilder(); IRI buildCanvasIRI(final String canvasIdString); IRI buildResourceIRI(final String resourceIdString); IRI buildServiceIRI(final String imageServiceContext, final String resourceIdString); String buildImageServiceContext(final String viewId); String buildCanvasIRIfromPhysical(final String physical); String buildAnnotationId(); }
IRIBuilder { public String buildImageServiceContext(final String viewId) { final int viewIdInt = parseInt(viewId); final String v = format("%010d", viewIdInt); final String imageDirPrefix = config.getImageServiceImageDirPrefix(); final int part1 = parseInt(v.substring(0,4)); final String first = format("%04d", part1); final int part2 = parseInt(v.substring(5,8)); final String second = format("%04d", part2); if (config.getIsUBLImageService()) { return config.getImageServiceBaseUrl() + imageDirPrefix + first + separator + second + separator + v; } else { return config.getImageServiceBaseUrl() + viewId; } } IRIBuilder(final Config config); private  IRIBuilder(); IRI buildCanvasIRI(final String canvasIdString); IRI buildResourceIRI(final String resourceIdString); IRI buildServiceIRI(final String imageServiceContext, final String resourceIdString); String buildImageServiceContext(final String viewId); String buildCanvasIRIfromPhysical(final String physical); String buildAnnotationId();  }