Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class LastFM {
- String sessionkey = "";
- String username = "";
- String password = "";
- public LastFM() {
- readConfig("lastfm_config.txt");
- System.out.println("lastfm username: " + username + ", password: " + doAskterisks(password));
- }
- public static void main(String[] args) {
- if(args.length < 3) {
- System.out.println("Error: not enough args!");
- return;
- }
- LastFM scrobbler = new LastFM();
- }
- private String doAskterisks(String pass) {
- String ob = "";
- for(int i = 0; i < pass.length(); i++) {
- ob += "*";
- }
- return ob;
- }
- private void readConfig(String file) {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(file));
- username = in.readLine();
- password = in.readLine();
- } catch(java.io.IOException e) {
- System.err.println("Caught java.io.IOException: " + e.getMessage());
- } finally {
- if(in != null) {
- try {
- in.close();
- } catch(java.io.IOException e) {
- System.err.println("Caught java.io.IOException: " + e.getMessage());
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement