Methods Summary |
---|
public boolean | checkEntry(java.lang.String name)
// split the path into segments.
String[] segments = name.split("/");
// empty path? skip to next entry.
if (segments.length == 0) {
return false;
}
// Check each folders to make sure they should be included.
// Folders like CVS, .svn, etc.. should already have been excluded from the
// jar file, but we need to exclude some other folder (like /META-INF) so
// we check anyway.
for (int i = 0 ; i < segments.length - 1; i++) {
if (checkFolderForPackaging(segments[i]) == false) {
return false;
}
}
// get the file name from the path
String fileName = segments[segments.length-1];
return checkFileForPackaging(fileName);
|
public static boolean | checkFileForPackaging(java.lang.String fileName)Checks a file to make sure it should be packaged as standard resources.
String[] fileSegments = fileName.split("\\.");
String fileExt = "";
if (fileSegments.length > 1) {
fileExt = fileSegments[fileSegments.length-1];
}
return checkFileForPackaging(fileName, fileExt);
|
public static boolean | checkFileForPackaging(java.lang.String fileName, java.lang.String extension)Checks a file to make sure it should be packaged as standard resources.
return "aidl".equalsIgnoreCase(extension) == false &&
"java".equalsIgnoreCase(extension) == false &&
"class".equalsIgnoreCase(extension) == false &&
"package.html".equalsIgnoreCase(fileName) == false &&
"overview.html".equalsIgnoreCase(fileName) == false &&
".cvsignore".equalsIgnoreCase(fileName) == false &&
".DS_Store".equals(fileName) == false &&
fileName.charAt(fileName.length()-1) != '~";
|
public static boolean | checkFolderForPackaging(java.lang.String folderName)Checks whether a folder and its content is valid for packaging into the .apk as
standard Java resource.
return folderName.equals("CVS") == false &&
folderName.equals(".svn") == false &&
folderName.equals("SCCS") == false &&
folderName.equals("META-INF") == false &&
folderName.startsWith("_") == false;
|