add more override methods that handle project files
[jSite2.git] / src / net / pterodactylus / jsite / project / Project.java
index 9545b4d..65f28a1 100644 (file)
@@ -250,6 +250,18 @@ public class Project extends AbstractBean {
        /**
         * Adds a file override for the given file.
         * 
+        * @param projectFile
+        *            The file
+        * @param override
+        *            The override for the file
+        */
+       public void addFileOverride(ProjectFile projectFile, FileOverride override) {
+               addFileOverride(projectFile.getCompletePath(), override);
+       }
+
+       /**
+        * Adds a file override for the given file.
+        * 
         * @param filePath
         *            The file path
         * @param override
@@ -262,6 +274,16 @@ public class Project extends AbstractBean {
        /**
         * Removes the file override for the given file.
         * 
+        * @param projectFile
+        *            The file for which to remove the override
+        */
+       public void removeFileOverride(ProjectFile projectFile) {
+               removeFileOverride(projectFile.getCompletePath());
+       }
+
+       /**
+        * Removes the file override for the given file.
+        * 
         * @param filePath
         *            The file path for which to remove the override
         */
@@ -270,6 +292,30 @@ public class Project extends AbstractBean {
        }
 
        /**
+        * Returns the file override for the given file.
+        * 
+        * @param projectFile
+        *            The file for which to get the override
+        * @return The file override, or <code>null</code> if the given file does
+        *         not have an override
+        */
+       public FileOverride getFileOverride(ProjectFile projectFile) {
+               return getFileOverride(projectFile.getCompletePath());
+       }
+
+       /**
+        * Returns the file override for the given file.
+        * 
+        * @param filePath
+        *            The file path for which to get the override
+        * @return The file override, or <code>null</code> if the given file does
+        *         not have an override
+        */
+       public FileOverride getFileOverride(String filePath) {
+               return fileOverrides.get(filePath);
+       }
+
+       /**
         * Returns the list of {@link FileOverride}s.
         * 
         * @return All file overrides