Here you can find the source of getDirectoryString()
public static String getDirectoryString()
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { private final static Scanner commandLine = new Scanner(System.in); public static String getDirectoryString() { String sep = System.getProperty("path.separator"); String dir = commandLine.nextLine().toLowerCase().trim(); if (dir.charAt(dir.length() - 1) != sep.charAt(0)) { dir += sep;/* w w w. j av a 2 s .co m*/ } return dir; } }