Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
use url encoding on document path for statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Aug 31, 2012
1 parent cc71b48 commit 713d757
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions zanata-war/src/main/java/org/zanata/rest/service/ZPathService.java
Expand Up @@ -20,6 +20,8 @@
*/
package org.zanata.rest.service;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -99,8 +101,15 @@ public String generatePathForProjectIteration( HProjectIteration iteration )

public String generatePathForDocument( HDocument document )
{
String docIdNoSlash = RestUtil.convertToDocumentURIId( document.getDocId() );

String docIdNoSlash = null;
try
{
docIdNoSlash = URLEncoder.encode( RestUtil.convertToDocumentURIId( document.getDocId() ), "UTF-8" );
}
catch (UnsupportedEncodingException e)
{
throw new RuntimeException(e);
}
MessageFormat mssgFormat = new MessageFormat( DOCUMENT_ZPATH_PRIVATE );
return mssgFormat.format(
new Object[]{
Expand Down

0 comments on commit 713d757

Please sign in to comment.