add method to return complete path of a project file
[jSite2.git] / src / net / pterodactylus / jsite / project / Project.java
index 4d778ab..7a6ee10 100644 (file)
@@ -389,6 +389,19 @@ public class Project extends AbstractBean {
                }
 
                /**
+                * {@inheritDoc}
+                */
+               /* TODO - caching? */
+               public String getCompletePath() {
+                       StringBuilder completePath = new StringBuilder();
+                       ProjectFileImpl currentProjectFile = this;
+                       do {
+                               completePath.insert(0, File.separatorChar).insert(0, this.getName());
+                       } while ((currentProjectFile = currentProjectFile.parentProjectFile) != null);
+                       return completePath.substring(1);
+               }
+
+               /**
                 * @see net.pterodactylus.jsite.project.ProjectFile#isFile()
                 */
                public boolean isFile() {