public void testEncodePath() throws Exception { final String pathA = "/a b/c d/e f.txt"; final String pathEncoded = URLCodec.encodePath(pathA); Assert.assertEquals("/a%20b/c%20d/e%20f.txt", pathEncoded); final String pathZ = URLCodec.decode(pathEncoded); Assert.assertEquals(pathA, pathZ); }
private void checkManifestJar(URL url) throws Exception { final File file = URLCodec.toFile(url); final JarFile jarFile = new JarFile(file); final Manifest manifest = jarFile.getManifest(); Assert.assertEquals("1.0", ManifestU.getAttribute(manifest, "Manifest-Version")); Assert.assertNotNull(ManifestU.getImplementationBuild(manifest)); }
@Override public Object call(ExecutionContext context, Object self, Object... args) { String uriComponent = Types.toString(context, args[0]); String result = URLCodec.encode(context, uriComponent, URLCodec.URI_UNESCAPED_SET); return result; }