summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Narayan Kamath <narayan@google.com> 2014-05-01 15:37:15 +0100
committer Narayan Kamath <narayan@google.com> 2014-05-01 15:37:15 +0100
commit4948f0eee8789c85e793965315514975fc07403f (patch)
tree928842ee7ceab624864fe9a55ab9f9a0afd5351a
parent6442494046b954c5e33fc8b3657d0fb93cb83c39 (diff)
Fix build.
Bad automatic merge by git resulted in a dup. of a function. Change-Id: Idb8fd8a48e1a9f6aeac98a199d6b8c661efaab16
-rw-r--r--core/java/android/os/FileUtils.java22
1 files changed, 0 insertions, 22 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java
index d1c4221023d9..d71c3e6e2dbe 100644
--- a/core/java/android/os/FileUtils.java
+++ b/core/java/android/os/FileUtils.java
@@ -382,26 +382,4 @@ public class FileUtils {
}
return filePath.startsWith(dirPath);
}
-
- /**
- * Test if a file lives under the given directory, either as a direct child
- * or a distant grandchild.
- * <p>
- * Both files <em>must</em> have been resolved using
- * {@link File#getCanonicalFile()} to avoid symlink or path traversal
- * attacks.
- */
- public static boolean contains(File dir, File file) {
- String dirPath = dir.getAbsolutePath();
- String filePath = file.getAbsolutePath();
-
- if (dirPath.equals(filePath)) {
- return true;
- }
-
- if (!dirPath.endsWith("/")) {
- dirPath += "/";
- }
- return filePath.startsWith(dirPath);
- }
}