Code example for File

Methods: listFiles

0
 
    if (platformToolsAapt.isFile()) {
      return platformToolsAapt;
    } 
 
    File buildToolsFolder = new File(buildToolsHome());
    File[] buildToolsContent = buildToolsFolder.listFiles(new FileFilter() {
 
      @Override 
      public boolean accept(File pathname) {
        String fileName = pathname.getName();
 
        String regex = "\\d{2}\\.\\d{1}\\.\\d{1}";
        if (fileName.matches(regex) || fileName.startsWith(ANDROID_FOLDER_PREFIX)) {
          return true; 
        } 
        return false; 
      } 
    }); 
    if (buildToolsContent == null || buildToolsContent.length == 0) {
      throw new AndroidSdkException(