Skip to content

Commit

Permalink
Remove crashreport parameter and crashreport code.
Browse files Browse the repository at this point in the history
This change is not downwards compatible.
  • Loading branch information
nickrussler committed Feb 25, 2016
1 parent a666b3f commit 0d704b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
11 changes: 0 additions & 11 deletions src/main/java/cli/CommandLineParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public class CommandLineParameters {
@Parameter(names = {"-a", "--extract-attachments"}, description = "Extract Attachments.")
private boolean extractAttachments = false;

@Parameter(names = {"-dc", "--disable-crashreports"}, description = "Do not send crash reports to the developer.")
private boolean disableCrashreports = false;

@Parameter(names = {"-ad", "--extract-attachments-directory"}, description = "Extract Attachments to this Directory, if this option is not present the directory is besides the pdf as \"<pdf-name>-attachments\".")
private String extractAttachmentsDir;

Expand Down Expand Up @@ -153,14 +150,6 @@ public void setExtractAttachmentsDir(String extractAttachmentsDir) {
this.extractAttachmentsDir = extractAttachmentsDir;
}

public boolean isDisableCrashreports() {
return disableCrashreports;
}

public void setDisableCrashreports(boolean disableCrashreports) {
this.disableCrashreports = disableCrashreports;
}

public boolean isGui() {
return gui;
}
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/cli/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
* @author Nick Russler
*/
public class Main {
private static final String BUG_EMAIL_URL = "https://eml-to-pdf.com/email.php";

public static void main(String[] args) throws IOException {
CommandLineParameters cli = new CommandLineParameters();
JCommander jCmd = new JCommander(cli, args);
Expand Down Expand Up @@ -121,47 +119,6 @@ public static void main(String[] args) throws IOException {
MimeMessageConverter.convertToPdf(in, out, cli.isHideHeaders(), cli.isExtractAttachments(), cli.getExtractAttachmentsDir(), extParams);
} catch (Exception e) {
Logger.error("The eml could not be converted. Error: %s", Throwables.getStackTraceAsString(e));

if (!cli.isDisableCrashreports()) {
/* Try to send the bugreport via email */
StringBuilder bugdetails = new StringBuilder(800);

bugdetails.append("User: ");
bugdetails.append(System.getProperty("user.name"));
bugdetails.append("\n");

InetAddress localHost = InetAddress.getLocalHost();
bugdetails.append("Localhost: ");
bugdetails.append(localHost.getHostAddress());
bugdetails.append(" - ");
bugdetails.append(localHost.getHostName());
bugdetails.append("\n");

bugdetails.append("GEO: ");
bugdetails.append(HttpUtils.getRequest("http://ipinfo.io/json").replaceAll("\"", ""));
bugdetails.append("\n");

bugdetails.append("OS: ");
bugdetails.append(System.getProperty("os.name"));
bugdetails.append(" ");
bugdetails.append(System.getProperty("os.version"));
bugdetails.append(" ");
bugdetails.append(System.getProperty("os.arch"));
bugdetails.append("\n");

bugdetails.append("Java: ");
bugdetails.append(System.getProperty("java.vendor"));
bugdetails.append(" ");
bugdetails.append(System.getProperty("java.version"));
bugdetails.append("\n\n");

bugdetails.append("Exception\n");
bugdetails.append(Throwables.getStackTraceAsString(e));

String subject = "Bugreport from " + System.getProperty("user.name") + " | " + new Date();

HttpUtils.postRequest(BUG_EMAIL_URL, String.format("subject=%s&body=%s", subject, bugdetails.toString()));
}
}
}
}

0 comments on commit 0d704b4

Please sign in to comment.