com.android.ide.common.packaging
Class PackagingUtils

java.lang.Object
  extended by com.android.ide.common.packaging.PackagingUtils

public class PackagingUtils
extends java.lang.Object

Utility class for packaging.


Field Summary
static com.google.common.collect.ImmutableList<java.lang.String> NON_RESOURCES_EXTENSIONS
          Returns the list of file extensions that represents non resources files.
static com.google.common.collect.ImmutableList<java.lang.String> NON_RESOURCES_FILENAMES
          Return file names that are not resource files.
 
Constructor Summary
PackagingUtils()
           
 
Method Summary
static boolean checkFileForPackaging(java.lang.String fileName)
          Checks a file to make sure it should be packaged as standard resources.
static boolean checkFileForPackaging(java.lang.String fileName, boolean allowClassFiles)
          Checks a file to make sure it should be packaged as standard resources.
static boolean checkFileForPackaging(java.lang.String fileName, java.lang.String extension)
          Checks a file to make sure it should be packaged as standard resources.
static boolean checkFileForPackaging(java.lang.String fileName, java.lang.String extension, boolean allowClassFiles)
          Checks a file to make sure it should be packaged as standard resources.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NON_RESOURCES_EXTENSIONS

public static final com.google.common.collect.ImmutableList<java.lang.String> NON_RESOURCES_EXTENSIONS
Returns the list of file extensions that represents non resources files.


NON_RESOURCES_FILENAMES

public static final com.google.common.collect.ImmutableList<java.lang.String> NON_RESOURCES_FILENAMES
Return file names that are not resource files.

Constructor Detail

PackagingUtils

public PackagingUtils()
Method Detail

checkFolderForPackaging

public static boolean checkFolderForPackaging(@NonNull
                                              java.lang.String folderName)
Checks whether a folder and its content is valid for packaging into the .apk as standard Java resource.

Parameters:
folderName - the name of the folder.
Returns:
true if the folder is valid for packaging.

checkFileForPackaging

public static boolean checkFileForPackaging(@NonNull
                                            java.lang.String fileName,
                                            boolean allowClassFiles)
Checks a file to make sure it should be packaged as standard resources.

Parameters:
fileName - the name of the file (including extension)
allowClassFiles - whether to allow java class files
Returns:
true if the file should be packaged as standard java resources.

checkFileForPackaging

public static boolean checkFileForPackaging(@NonNull
                                            java.lang.String fileName)
Checks a file to make sure it should be packaged as standard resources.

Parameters:
fileName - the name of the file (including extension)
Returns:
true if the file should be packaged as standard java resources.

checkFileForPackaging

public static boolean checkFileForPackaging(@NonNull
                                            java.lang.String fileName,
                                            @NonNull
                                            java.lang.String extension,
                                            boolean allowClassFiles)
Checks a file to make sure it should be packaged as standard resources.

Parameters:
fileName - the name of the file (including extension)
extension - the extension of the file (excluding '.')
allowClassFiles - whether to allow java class files
Returns:
true if the file should be packaged as standard java resources.

checkFileForPackaging

public static boolean checkFileForPackaging(@NonNull
                                            java.lang.String fileName,
                                            @NonNull
                                            java.lang.String extension)
Checks a file to make sure it should be packaged as standard resources.

Parameters:
fileName - the name of the file (including extension)
extension - the extension of the file (excluding '.')
Returns:
true if the file should be packaged as standard java resources.