]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java
Restructuring for better separation of Tool packages.
[mirror_edk2.git] / Tools / Java / Source / Cpptasks / net / sf / antcontrib / cpptasks / SourceHistory.java
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java
new file mode 100644 (file)
index 0000000..0c608b4
--- /dev/null
@@ -0,0 +1,51 @@
+/*\r
+ * \r
+ * Copyright 2002-2004 The Ant-Contrib project\r
+ *\r
+ *  Licensed under the Apache License, Version 2.0 (the "License");\r
+ *  you may not use this file except in compliance with the License.\r
+ *  You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package net.sf.antcontrib.cpptasks;\r
+import java.io.File;\r
+import java.io.IOException;\r
+/**\r
+ * The history of a source file used to build a target\r
+ * \r
+ * @author Curt Arnold\r
+ */\r
+public final class SourceHistory {\r
+    private/* final */long lastModified;\r
+    private/* final */String relativePath;\r
+    /**\r
+     * Constructor\r
+     */\r
+    public SourceHistory(String relativePath, long lastModified) {\r
+        if (relativePath == null) {\r
+            throw new NullPointerException("relativePath");\r
+        }\r
+        this.relativePath = relativePath;\r
+        this.lastModified = lastModified;\r
+    }\r
+    public String getAbsolutePath(File baseDir) {\r
+        try {\r
+            return new File(baseDir, relativePath).getCanonicalPath();\r
+        } catch (IOException ex) {\r
+        }\r
+        return relativePath;\r
+    }\r
+    public long getLastModified() {\r
+        return lastModified;\r
+    }\r
+    public String getRelativePath() {\r
+        return relativePath;\r
+    }\r
+}\r