Java tutorial
//package com.java2s; //License from project: Apache License import java.net.URLEncoder; public class Main { public static String getSmbServerUrl(String[] auth, boolean anonym) { String smbFilePath; try { String yourPeerIP = auth[0], domain = ""; smbFilePath = "smb://" + (anonym ? "" : (URLEncoder.encode(auth[1] + ":" + auth[2], "UTF-8") + "@")) + yourPeerIP + "/"; return smbFilePath; } catch (Exception e) { e.printStackTrace(); return null; } } }