@Test public void requiresModelNameToBeValidWhenParsing() throws IOException { Assertions.assertThrows(IllegalArgumentException.class, () -> { ModelDiscovery.getSmithyModelPathFromJarUrl(new URL("jar:file:/a.jar!/blerg.json")); }); }
public static String getSmithyModelPathFromJarUrl(URL modelUrl) { String urlString = modelUrl.toString(); int position = urlString.indexOf(ROOT_RESOURCE_PATH); if (position == -1) { throw new IllegalArgumentException("Invalid Smithy model URL: " + modelUrl); } return urlString.substring(position + ROOT_RESOURCE_PATH.length()); }
ModelDiscovery { public static String getSmithyModelPathFromJarUrl(URL modelUrl) { String urlString = modelUrl.toString(); int position = urlString.indexOf(ROOT_RESOURCE_PATH); if (position == -1) { throw new IllegalArgumentException("Invalid Smithy model URL: " + modelUrl); } return urlString.substring(position + ROOT_RESOURCE_PATH.length()); } }
ModelDiscovery { public static String getSmithyModelPathFromJarUrl(URL modelUrl) { String urlString = modelUrl.toString(); int position = urlString.indexOf(ROOT_RESOURCE_PATH); if (position == -1) { throw new IllegalArgumentException("Invalid Smithy model URL: " + modelUrl); } return urlString.substring(position + ROOT_RESOURCE_PATH.length()); } private  ModelDiscovery(); }
ModelDiscovery { public static String getSmithyModelPathFromJarUrl(URL modelUrl) { String urlString = modelUrl.toString(); int position = urlString.indexOf(ROOT_RESOURCE_PATH); if (position == -1) { throw new IllegalArgumentException("Invalid Smithy model URL: " + modelUrl); } return urlString.substring(position + ROOT_RESOURCE_PATH.length()); } private  ModelDiscovery(); static List<URL> findModels(); static List<URL> findModels(ClassLoader loader); static List<URL> findModels(URL jarManifestUrl); static String getSmithyModelPathFromJarUrl(URL modelUrl); static URL createSmithyJarManifestUrl(String fileOrUrl); }
ModelDiscovery { public static String getSmithyModelPathFromJarUrl(URL modelUrl) { String urlString = modelUrl.toString(); int position = urlString.indexOf(ROOT_RESOURCE_PATH); if (position == -1) { throw new IllegalArgumentException("Invalid Smithy model URL: " + modelUrl); } return urlString.substring(position + ROOT_RESOURCE_PATH.length()); } private  ModelDiscovery(); static List<URL> findModels(); static List<URL> findModels(ClassLoader loader); static List<URL> findModels(URL jarManifestUrl); static String getSmithyModelPathFromJarUrl(URL modelUrl); static URL createSmithyJarManifestUrl(String fileOrUrl);  }