-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0a66bc
commit e9eb209
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
yamf-core/src/main/java/nz/ac/wgtn/yamf/commons/Files.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package nz.ac.wgtn.yamf.commons; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
|
||
/** | ||
* File related utilities. | ||
* @author jens dietrich | ||
*/ | ||
public class Files { | ||
public static String relativize(File file, File baseFolder) { | ||
Path pathAbsolute = file.toPath(); | ||
Path pathBase = baseFolder.toPath(); | ||
return pathBase.relativize(pathAbsolute).toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters