Actually you could avoid all this looping and just use a pattern:
```
private static Pattern UNSAFE_TOKENS = Pattern.compile("[.\\:/]"); // double-check this regexp :)
//...
return UNSAFE_TOKENS.matcher(blobId.getId()).replaceAll("-");
```