Code:
package muledumpmasscreator;
import java****.FileInputStream;
import java****.FileNotFoundException;
import java********Exception;
import java****.InputStream;
import java.util.Properties;
import java.util.Scanner;
public class MDCreator {
public static String emailPrefix = "";
public static String emailBody = "";
public static String emailPassword = "";
public static double numberOfMules;
public static double currentMule = 0;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Welcome. Enter Y.");
if (in.nextLine().equals("Y")) {
System.out.println("Making from account.properties.");
System.out.print("Number of mules to make :");
currentMule = in.nextDouble();
fromAccountProperties();
} else {
System.out.println("Making from input.");
fromValue();
}
}
private static void fromAccountProperties() {
Properties p = new Properties();
InputStream in;
try {
in = new FileInputStream("account.properties");
p.load(in);
in.close();
emailPrefix = p.getProperty("emailPrefix");
emailBody = p.getProperty("emailBody");
emailPassword = p.getProperty("emailPassword");
makeMD();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (int i = 0; i < numberOfMules; i++) {
currentMule++;
System.out.println("'" + emailPrefix + currentMule + emailBody + "', '" + emailPassword + "',");
}
}
private static void fromValue() {
Scanner in = new Scanner(System.in);
System.out.print("Enter email prefix. ");
emailPrefix = in.nextLine();
System.out.print("Enter the rest. ");
emailBody = in.nextLine();
System.out.print("Number of emails : ");
numberOfMules = in.nextDouble();
System.out.print("Enter the password. ");
emailPassword = in.nextLine();
in.nextLine();
in.close();
makeMD();
}
private static void makeMD() {
for (int i = 0; i < numberOfMules; i++) {
currentMule++;
System.out.println("'" + emailPrefix + (int) currentMule + emailBody + "': '" + emailPassword + "',");
}
}
}
It creates a list of emails with set prefix#@domain.com