@Test public void testMissingFile() { tried.expect(BuildException.class); tried.expectMessage("file not set"); Find find = new Find(); find.execute(); }
public void execute() { validate(); String foundLocation = null; for (Path path : paths) { for (String includedFile : path.list()) { String filename = includedFile.replace('\\','/'); filename = filename.substring(filename.lastIndexOf("/") + 1); if (foundLocation == null && file.equals(filename)) { foundLocation = includedFiles[i]; } } } if (foundLocation != null) getProject().setNewProperty(location, foundLocation); }
Find extends Task { public void execute() { validate(); String foundLocation = null; for (Path path : paths) { for (String includedFile : path.list()) { String filename = includedFile.replace('\\','/'); filename = filename.substring(filename.lastIndexOf("/") + 1); if (foundLocation == null && file.equals(filename)) { foundLocation = includedFiles[i]; } } } if (foundLocation != null) getProject().setNewProperty(location, foundLocation); } }
Find extends Task { public void execute() { validate(); String foundLocation = null; for (Path path : paths) { for (String includedFile : path.list()) { String filename = includedFile.replace('\\','/'); filename = filename.substring(filename.lastIndexOf("/") + 1); if (foundLocation == null && file.equals(filename)) { foundLocation = includedFiles[i]; } } } if (foundLocation != null) getProject().setNewProperty(location, foundLocation); }  }
Find extends Task { public void execute() { validate(); String foundLocation = null; for (Path path : paths) { for (String includedFile : path.list()) { String filename = includedFile.replace('\\','/'); filename = filename.substring(filename.lastIndexOf("/") + 1); if (foundLocation == null && file.equals(filename)) { foundLocation = includedFiles[i]; } } } if (foundLocation != null) getProject().setNewProperty(location, foundLocation); }  void setFile(String file); void setLocation(String location); void addPath(Path path); void execute(); }
Find extends Task { public void execute() { validate(); String foundLocation = null; for (Path path : paths) { for (String includedFile : path.list()) { String filename = includedFile.replace('\\','/'); filename = filename.substring(filename.lastIndexOf("/") + 1); if (foundLocation == null && file.equals(filename)) { foundLocation = includedFiles[i]; } } } if (foundLocation != null) getProject().setNewProperty(location, foundLocation); }  void setFile(String file); void setLocation(String location); void addPath(Path path); void execute();  }