Java tutorial
//package com.java2s; public class Main { /** * To escape characters that can not be used in the file name from the URI. * * @param uri * @return */ private static String escapeUri(String uri) { return uri.replace("://", "_").replace("/", "_"); } }