aboutsummaryrefslogtreecommitdiffstats
path: root/jarutils/src
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-11-02 18:31:46 -0800
committerXavier Ducrohet <xav@android.com>2009-11-02 18:31:46 -0800
commitb9e05e771fc17d78ce4254ecd5651173f03cdc13 (patch)
tree59c440cd5403352e3ea7f0cae2bbcf23a2cdd32d /jarutils/src
parent2555661dcc794929665276e87c07dc8e608c89fc (diff)
downloadsdk-b9e05e771fc17d78ce4254ecd5651173f03cdc13.zip
sdk-b9e05e771fc17d78ce4254ecd5651173f03cdc13.tar.gz
sdk-b9e05e771fc17d78ce4254ecd5651173f03cdc13.tar.bz2
Ignore hidden files and vi swap files during packaging.
BUG #2233458 Change-Id: If0d0751ed7b896a7803e9b69fb0e6bff97dd4330
Diffstat (limited to 'jarutils/src')
-rw-r--r--jarutils/src/com/android/jarutils/JavaResourceFilter.java7
1 files changed, 6 insertions, 1 deletions
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