update doclava for s.a.c redesign
Change-Id: I4788472ea2ba923070362624f75fe72bf5b43df7
Conflicts:
src/com/google/doclava/ClearPage.java
diff --git a/src/com/google/doclava/ClearPage.java b/src/com/google/doclava/ClearPage.java
index 9c512c9..4a6d39a 100644
--- a/src/com/google/doclava/ClearPage.java
+++ b/src/com/google/doclava/ClearPage.java
@@ -28,6 +28,7 @@
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
+import java.util.Arrays;
public class ClearPage {
/*
@@ -156,7 +157,7 @@
}
}
- public static void copyFile(File from, String toPath) {
+ public static void copyFile(boolean allowExcepted, File from, String toPath) {
File to = new File(outputDir + "/" + toPath);
FileInputStream in;
FileOutputStream out;
@@ -176,7 +177,7 @@
System.err.println(from.getAbsolutePath() + ": Error opening file");
return;
}
- if (!isValidContentType(toPath, DROIDDOC_VALID_CONTENT_TYPES)) {
+ if (!isValidContentType(allowExcepted, toPath, DROIDDOC_VALID_CONTENT_TYPES)) {
Errors.error(Errors.INVALID_CONTENT_TYPE, null, "Failed to process " + from
+ ": Invalid file type. Please move the file to frameworks/base/docs/image_sources/... or docs/downloads/...");
return;
@@ -220,9 +221,15 @@
}
}
- public static String[] DROIDDOC_VALID_CONTENT_TYPES = {".txt", ".css", ".js", ".html", ".ico", ".png", ".jpg", ".gif", ".svg", ".webm", ".ogv","mp4", ".java", ".xml", ".aidl", ".rs",".zip", ".yaml", ".pdf"};
+ public static ArrayList<String> DROIDDOC_VALID_CONTENT_TYPES = new ArrayList<String>(Arrays.asList(".txt", ".css",
+ ".js", ".html", ".ico", ".png", ".jpg", ".gif", ".svg", ".webm", ".ogv","mp4", ".java", ".xml", ".aidl", ".rs",".zip", ".yaml"));
- public static boolean isValidContentType(String s, String[] list) {
+ public static ArrayList<String> DROIDDOC_EXCEPTED_CONTENT_TYPES = new ArrayList<String>(Arrays.asList(".pdf"));
+
+ public static boolean isValidContentType(boolean allowExcepted, String s, ArrayList<String> list) {
+ if(allowExcepted){
+ list.addAll(DROIDDOC_EXCEPTED_CONTENT_TYPES);
+ }
for (String t : list) {
if (s.endsWith(t)) {
return true;