package org.postgresforest.tool.util;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.net.Authenticator;
import java.net.PasswordAuthentication;

public class InputPassword extends Authenticator{
	public PasswordAuthentication getPasswordAuthentication() {
		String user = "";
		String password = "";
		try {
			// パスワードの取得
			System.out.print("input password >");
			LineNumberReader in = new LineNumberReader(new InputStreamReader(System.in));
			password = in.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new PasswordAuthentication(user, password.toCharArray());
	}
	
}
