Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ZNTA-1771-tmx
- Loading branch information
Showing
424 changed files
with
27,052 additions
and
6,468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 15 additions & 4 deletions
19
api/zanata-common-api/src/main/java/org/zanata/rest/RestUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
package org.zanata.rest; | ||
|
||
import javax.ws.rs.core.Response; | ||
|
||
public class RestUtil { | ||
|
||
public static String convertToDocumentURIId(String id) { | ||
public static String convertToDocumentURIId(String docId) { | ||
// NB this currently prevents us from allowing ',' in file names | ||
if (id.startsWith("/")) { | ||
return id.substring(1).replace('/', ','); | ||
if (docId.startsWith("/")) { | ||
return docId.substring(1).replace('/', ','); | ||
} | ||
return id.replace('/', ','); | ||
return docId.replace('/', ','); | ||
} | ||
|
||
public static String convertFromDocumentURIId(String docIdWithNoSlash) { | ||
return docIdWithNoSlash.replace(',', '/'); | ||
} | ||
|
||
public static boolean isNotFound(Response response) { | ||
return response.getStatus() == | ||
Response.Status.NOT_FOUND.getStatusCode(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.