@Test public void testReleaseInfo() throws Exception { Release release = prepareReleaseWithFiles(); release.saveInfo(); String info = FileUtil.getFileContent("releases/xyz/.releaseInfo"); assertSubString("file1", info); assertSubString("file2", info); }
public void saveInfo() { FileWriter writer = null; try { writer = new FileWriter(infoFile); for (Iterator iterator = getFiles().iterator(); iterator.hasNext();) writer.write(iterator.next().toString() + "\n"); writer.flush(); writer.close(); writer = null; } catch (IOException e) { e.printStackTrace(); } finally{ if (writer != null) { try { writer.close(); } catch (Exception e2) { } } } }
Release { public void saveInfo() { FileWriter writer = null; try { writer = new FileWriter(infoFile); for (Iterator iterator = getFiles().iterator(); iterator.hasNext();) writer.write(iterator.next().toString() + "\n"); writer.flush(); writer.close(); writer = null; } catch (IOException e) { e.printStackTrace(); } finally{ if (writer != null) { try { writer.close(); } catch (Exception e2) { } } } } }
Release { public void saveInfo() { FileWriter writer = null; try { writer = new FileWriter(infoFile); for (Iterator iterator = getFiles().iterator(); iterator.hasNext();) writer.write(iterator.next().toString() + "\n"); writer.flush(); writer.close(); writer = null; } catch (IOException e) { e.printStackTrace(); } finally{ if (writer != null) { try { writer.close(); } catch (Exception e2) { } } } } Release(String name); }
Release { public void saveInfo() { FileWriter writer = null; try { writer = new FileWriter(infoFile); for (Iterator iterator = getFiles().iterator(); iterator.hasNext();) writer.write(iterator.next().toString() + "\n"); writer.flush(); writer.close(); writer = null; } catch (IOException e) { e.printStackTrace(); } finally{ if (writer != null) { try { writer.close(); } catch (Exception e2) { } } } } Release(String name); String getName(); boolean exists(); int fileCount(); void saveInfo(); List<ReleaseFile> getFiles(); ReleaseFile getFile(String filename); boolean isCorrupted(); }
Release { public void saveInfo() { FileWriter writer = null; try { writer = new FileWriter(infoFile); for (Iterator iterator = getFiles().iterator(); iterator.hasNext();) writer.write(iterator.next().toString() + "\n"); writer.flush(); writer.close(); writer = null; } catch (IOException e) { e.printStackTrace(); } finally{ if (writer != null) { try { writer.close(); } catch (Exception e2) { } } } } Release(String name); String getName(); boolean exists(); int fileCount(); void saveInfo(); List<ReleaseFile> getFiles(); ReleaseFile getFile(String filename); boolean isCorrupted(); static final String ENDL; }