@Test public void testContainsFile() { projectFiles.add("directory/pom.xml"); Project p = new Project(exercise, projectFiles); assertTrue(!p.containsFile(null)); assertTrue(p.containsFile("directory/trololo")); }
public boolean containsFile(String file) { if (file == null || rootPath.isEmpty()) { return false; } return (file + "/").contains(rootPath + "/"); }
Project { public boolean containsFile(String file) { if (file == null || rootPath.isEmpty()) { return false; } return (file + "/").contains(rootPath + "/"); } }
Project { public boolean containsFile(String file) { if (file == null || rootPath.isEmpty()) { return false; } return (file + "/").contains(rootPath + "/"); } Project(Exercise exercise);  Project(Exercise exercise, List<String> projectFiles); }
Project { public boolean containsFile(String file) { if (file == null || rootPath.isEmpty()) { return false; } return (file + "/").contains(rootPath + "/"); } Project(Exercise exercise);  Project(Exercise exercise, List<String> projectFiles); Exercise getExercise(); void setExercise(Exercise exercise); String getRootPath(); ProjectType getProjectType(); boolean containsFile(String file); @Override boolean equals(Object o); @Override int hashCode(); ZippingDecider getZippingDecider(); void setProjectFiles(List<String> files); List<String> getReadOnlyProjectFiles(); String getProjectFileByName(String fileName); void addProjectFile(String file); void removeProjectFile(String path); void setExtraStudentFiles(List<String> files); List<String> getExtraStudentFiles(); boolean existsOnDisk(); ProjectStatus getStatus(); void setStatus(ProjectStatus status); }
Project { public boolean containsFile(String file) { if (file == null || rootPath.isEmpty()) { return false; } return (file + "/").contains(rootPath + "/"); } Project(Exercise exercise);  Project(Exercise exercise, List<String> projectFiles); Exercise getExercise(); void setExercise(Exercise exercise); String getRootPath(); ProjectType getProjectType(); boolean containsFile(String file); @Override boolean equals(Object o); @Override int hashCode(); ZippingDecider getZippingDecider(); void setProjectFiles(List<String> files); List<String> getReadOnlyProjectFiles(); String getProjectFileByName(String fileName); void addProjectFile(String file); void removeProjectFile(String path); void setExtraStudentFiles(List<String> files); List<String> getExtraStudentFiles(); boolean existsOnDisk(); ProjectStatus getStatus(); void setStatus(ProjectStatus status);  }