Java Scanner Usage getDirectoryString()

Here you can find the source of getDirectoryString()

Description

get Directory String

License

Open Source License

Declaration

public static String getDirectoryString() 

Method Source Code

//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;
    }
}

Related

  1. equalsToIgnoreEndline(String expected, String actual)
  2. fromStringToQuery(String value)
  3. getBoolean()
  4. getChar()
  5. getConstantPoolsFromText(String text)
  6. getEndLine(String cqlString)
  7. getExtensions(Scanner scanner)
  8. getFirstInt(String s)
  9. getInput(Scanner in, String message, boolean allowNull)