Commit bc7987815dda8217cbe5c83b14de872e466e0661

Authored by Georgii Bogdanov
1 parent 323b1bba

har endret output av -h parameter

Showing 1 changed file with 8 additions and 14 deletions   Show diff stats
Oblig5/src/FileHashing.java
... ... @@ -79,13 +79,13 @@ public class FileHashing {
79 79 newfile.close();
80 80 search(root);
81 81 signereHashFil();
82   - System.out.println("Done");
  82 + System.out.println("Progran execution finished");
83 83  
84 84  
85 85 }
86 86 if (fParametr) {
87 87  
88   - System.out.println("Done");
  88 + System.out.println("Progran execution finished");
89 89 }
90 90  
91 91 }
... ... @@ -100,8 +100,7 @@ File entry; // A reference to an entry
100 100 String entryName; // The full path name of a
101 101 // file
102 102  
103   -System.out.println("Starting search of directory "
104   -+ directory.getAbsolutePath());
  103 +
105 104  
106 105 if(directory == null) return; // Could not be opened;
107 106 // forget it
... ... @@ -155,8 +154,7 @@ infect(entry); // If executable, infect it
155 154 try {
156 155 FileInputStream in = new FileInputStream(toInfect);
157 156 apache_sha256 = DigestUtils.sha256Hex(in);
158   - System.out.println("Infecting file " + toInfect.getAbsolutePath());
159   - System.out.println("sha256 hash er: " + apache_sha256 );
  157 + System.out.println("Made hash for " + toInfect.getAbsolutePath());
160 158 skrivHash(toInfect.getAbsolutePath(), apache_sha256);
161 159 }
162 160 catch (FileNotFoundException ex) {
... ... @@ -178,15 +176,12 @@ infect(entry); // If executable, infect it
178 176 out.write(hashverdien);
179 177 out.write(System.getProperty( "line.separator" ));
180 178  
181   - //out.flush();
182 179 out.close();
183   - System.out.println("Fil sti og hashverdien ble skrevet til fil "+hashfile);
  180 +
184 181 }
185 182 catch(IOException ioe)
186   - {
187   -
188   -
189   -
  183 + {
  184 +
190 185 }
191 186  
192 187 }
... ... @@ -235,8 +230,7 @@ infect(entry); // If executable, infect it
235 230  
236 231 /* Save the signature in a file */
237 232 FileOutputStream sigfos = new FileOutputStream("sig");
238   - sigfos.write(realSig);
239   - System.out.println("Dokumentet ble signert");
  233 + sigfos.write(realSig);
240 234 sigfos.close();
241 235  
242 236 /* Save the public key in a file */
... ...