Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
  @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;
  }