From b9e05e771fc17d78ce4254ecd5651173f03cdc13 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Mon, 2 Nov 2009 18:31:46 -0800 Subject: Ignore hidden files and vi swap files during packaging. BUG #2233458 Change-Id: If0d0751ed7b896a7803e9b69fb0e6bff97dd4330 --- jarutils/src/com/android/jarutils/JavaResourceFilter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'jarutils/src') diff --git a/jarutils/src/com/android/jarutils/JavaResourceFilter.java b/jarutils/src/com/android/jarutils/JavaResourceFilter.java index 1a97e28..51f4990 100644 --- a/jarutils/src/com/android/jarutils/JavaResourceFilter.java +++ b/jarutils/src/com/android/jarutils/JavaResourceFilter.java @@ -68,6 +68,10 @@ public class JavaResourceFilter implements IZipEntryFilter { * @return true if the file should be packaged as standard java resources. */ public static boolean checkFileForPackaging(String fileName) { + if (fileName.charAt(0) == '.') { // ignore hidden files. + return false; + } + String[] fileSegments = fileName.split("\\."); String fileExt = ""; if (fileSegments.length > 1) { @@ -83,11 +87,12 @@ public class JavaResourceFilter implements IZipEntryFilter { * @param extension the extension of the file (excluding '.') * @return true if the file should be packaged as standard java resources. */ - public static boolean checkFileForPackaging(String fileName, String extension) { + private static boolean checkFileForPackaging(String fileName, String extension) { return "aidl".equalsIgnoreCase(extension) == false && // Aidl files "java".equalsIgnoreCase(extension) == false && // Java files "class".equalsIgnoreCase(extension) == false && // Java class files "scc".equalsIgnoreCase(extension) == false && // VisualSourceSafe + "swp".equalsIgnoreCase(extension) == false && // vi swap file "package.html".equalsIgnoreCase(fileName) == false && // Javadoc "overview.html".equalsIgnoreCase(fileName) == false && // Javadoc ".cvsignore".equalsIgnoreCase(fileName) == false && // CVS -- cgit v1.1