code: private static void processFileForResource(IArchiveBuilder builder, File file, String path)
              throws IOException, DuplicateFileException, ApkCreationException, SealedApkException {
          if (file.isDirectory()) {
              // a directory? we check it
              if (checkFolderForPackaging(file.getName())) {
                  // if it's valid, we append its name to the current path.
                  if (path == null) {
                      path = file.getName();
                  } else {
                      path = path + "/" + file.getName();
                  }
  
                  // and process its content.
                  File[] files = file.listFiles();
                  if (files != null) {
                      for (File contentFile : files) {
                          processFileForResource(builder, contentFile, path);
                      }
                  }
              }
          } else {
              // a file? we check it to make sure it should be added
              if (checkFileForPackaging(file.getName())) {
                  // we append its name to the current path
                  if (path == null) {
                      path = file.getName();
                  } else {
                      path = path + "/" + file.getName();
                  }
  
                  // and add it to the apk
                  builder.addFile(file, path);
              }
          }
      }
docs: Processes a {@link File} that could be an APK {@link File}, or a folder containing
  java resources.
  
  @param file the {@link File} to process.
  @param path the relative path of this file to the source folder.
  Can be <code>null</code> to identify a root file.
  @throws IOException
  @throws DuplicateFileException if a file conflicts with another already added
  to the APK at the same location inside the APK archive.
  @throws SealedApkException if the APK is already sealed.
  @throws ApkCreationException if an error occurred