Rev 32 | Rev 38 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 32 | Rev 37 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | private String backupDir = "backup"; |
31 | private String backupDir = "backup"; |
32 | 32 | ||
33 | private static final int INITIAL_SIZE = 1000000; |
33 | private static final int INITIAL_SIZE = 1000000; |
34 | private static final int EXPANSION_SIZE = 1000000; |
34 | private static final int EXPANSION_SIZE = 1000000; |
35 | 35 | ||
36 | private boolean do_integrity_test = false; |
36 | private boolean do_integrity_test = true; |
37 | private boolean verbose = false; |
37 | private boolean verbose = true; |
38 | 38 | ||
39 | public boolean isDo_integrity_test() { |
39 | public boolean isDo_integrity_test() { |
40 | return do_integrity_test; |
40 | return do_integrity_test; |
41 | } |
41 | } |
42 | 42 | ||
Line 53... | Line 53... | ||
53 | } |
53 | } |
54 | 54 | ||
55 | protected void log(String s) { |
55 | protected void log(String s) { |
56 | if (verbose) { |
56 | if (verbose) { |
57 | String timestamp = DateUtils.now("EEE, d MMM yyyy HH:mm:ss Z"); |
57 | String timestamp = DateUtils.now("EEE, d MMM yyyy HH:mm:ss Z"); |
58 | System.out.println(timestamp + " - " + s); // FURUE: In eine |
58 | // FUTURE: In eine Log-Datei schreiben |
59 | // Log-Datei schreiben |
59 | System.out.println(timestamp + " - " + s); |
60 | } |
60 | } |
61 | } |
61 | } |
62 | 62 | ||
63 | public ImmortalNumberSearch(String filename) throws LoadException { |
63 | public ImmortalNumberSearch(String filename) throws LoadException { |
64 | this.filename = filename; |
64 | this.filename = filename; |
Line 181... | Line 181... | ||
181 | throw new SaveException( |
181 | throw new SaveException( |
182 | "Integrity test failed. (Loaded file broken?) Will not save."); |
182 | "Integrity test failed. (Loaded file broken?) Will not save."); |
183 | } |
183 | } |
184 | } |
184 | } |
185 | 185 | ||
186 | log("Speichere bei u=" + (u + 1)); |
186 | log("Speichere bei " + (u + 1) + " digits"); |
187 | 187 | ||
188 | String timestamp = DateUtils.now("EEE, d MMM yyyy HH:mm:ss Z"); |
188 | String timestamp = DateUtils.now("EEE, d MMM yyyy HH:mm:ss Z"); |
189 | String timestamp_filename = DateUtils.now("dd-MM-yyyy_HH-mm-ss"); |
189 | String timestamp_filename = DateUtils.now("dd-MM-yyyy_HH-mm-ss"); |
190 | 190 | ||
191 | try { |
191 | try { |
Line 226... | Line 226... | ||
226 | f.write("\r\n"); |
226 | f.write("\r\n"); |
227 | } |
227 | } |
228 | f.write("\r\n"); |
228 | f.write("\r\n"); |
229 | 229 | ||
230 | f.write(END_SIG); |
230 | f.write(END_SIG); |
- | 231 | f.write("\r\n"); |
|
231 | } finally { |
232 | } finally { |
232 | f.close(); |
233 | f.close(); |
233 | } |
234 | } |
234 | } catch (IOException e) { |
235 | } catch (IOException e) { |
235 | throw new SaveException("Could not save master file.", e); |
236 | throw new SaveException("Could not save master file.", e); |