Skip to content

Commit

Permalink
version 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jensdietrich committed Jun 24, 2020
1 parent c81ccdb commit 514f3db
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.6</version>
<version>1.0.7</version>
<name>yamf-parent</name>
<properties>
<project-version>1.0.6</project-version>
<project-version>1.0.7</project-version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion yamf-acceptancetests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-acceptancetests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamf-bytecodechecks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-bytecodechecks</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-core</artifactId>
Expand Down
28 changes: 28 additions & 0 deletions yamf-core/src/main/java/nz/ac/wgtn/yamf/commons/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ public static String relativize(File file, File baseFolder) {
return pathBase.relativize(pathAbsolute).toString();
}

/**
* Find an ancestor satidfying a certain condition.
* @param file
* @param condition
* @param includeSelf -- whether file is also being considered
* @return
*/
public static File findAncestorSuchThat(File file, Predicate<File> condition, boolean includeSelf) {
Preconditions.checkNotNull(file);
Preconditions.checkArgument(file.exists());
if (includeSelf && condition.test(file)) {
return file;
}
return doFindAncestorSuchThat(file.getParentFile(),condition);
}

private static File doFindAncestorSuchThat(File file, Predicate<File> condition) {
if (condition.test(file)) {
return file;
}
File parent = file.getParentFile();
if (parent==null) {
return null;
}
else {
return doFindAncestorSuchThat(parent,condition);
}
}

/**
* Breath-first traverse children to find a child file or folder satisfying a condition.
Expand Down
2 changes: 1 addition & 1 deletion yamf-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamf-msoffice-reporting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-msoffice-reporting</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion yamf-mvn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-parent</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</parent>
<groupId>nz.ac.wgtn.yamf</groupId>
<artifactId>yamf-mvn</artifactId>
Expand Down

0 comments on commit 514f3db

Please sign in to comment.