/** * Create URL to access REST API based on provided parameters * * @return * @throws Exception */ private String createPurgeServiceURL() throws Exception { StringBuffer service = new StringBuffer(); service.append( url ); service.append( BASE_PATH ); service.append( "/" ); String path = RepositoryPathEncoder.encodeRepositoryPath( repositoryPath ); path = RepositoryPathEncoder.encode( path ); service.append( path + "/" ); service.append( SERVICE_NAME ); return service.toString(); }
@Test public void testEncode() { Assert.assertEquals( "%3Apublic%3ASteel%20Wheels%3AFile%09WithColon", RepositoryPathEncoder .encode( ":public:Steel Wheels:File\tWithColon" ) ); Assert.assertEquals( "%3Apublic%3ASteel%20Wheels%3AFile%09With%255CColon", RepositoryPathEncoder .encode( ":public:Steel Wheels:File\tWith%5CColon" ) ); }