public void saveToFile(File f) {
        try {
            File out = new File(f.getPath() + System.getProperty("file.separator") + getRuleName() + ".rule");
            try (BufferedWriter bw = new BufferedWriter(new FileWriter(out, false))) {
                bw.write(getRuleName()); bw.newLine();
                bw.write(getRuleURL()); bw.newLine();
                bw.write(getRuleRegExpr()); bw.newLine();
                bw.write((this.isIsEnabled()) ? "1" : "0"); bw.newLine();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }        
    }