src/main/java/org/edgegallery/appstore/interfaces/apackage/facade/PackageServiceFacade.java
public static List<File> searchTempFiles(File folder, String keyword) {
        List<File> result = new ArrayList<>();
        if (folder.isFile()) {
            result.add(folder);
        }
        File[] subFolders = folder.listFiles(file -> file.isDirectory() || file.getName().startsWith(keyword));
        if (subFolders != null) {
            for (File file : subFolders) {
                if (file.isFile()) {
                    // add result list if  it is file
                    result.add(file);
                } else {
                    // If it is a folder, call this method recursively, and then add all files to the result list
                    result.addAll(searchTempFiles(file, keyword));
                }
            }
        }
        return result;
    }
/**
     * Search for the file containing the keyword in the specified directory.
     *
     * @param folder resource folder.
     * @param keyword keyword.
     */
Search for the file containing the keyword in the specified directory.
@param folder resource folder.
@param keyword keyword.
Search for the file containing the keyword in the specified directory . @param folder resource folder . @param keyword keyword .
public static List<File> searchTempFiles(File folder, String keyword) {
        List<File> result = new ArrayList<>();
        if (folder.isFile()) {
            result.add(folder);
        }
        File[] subFolders = folder.listFiles(file -> file.isDirectory() || file.getName().startsWith(keyword));
        if (subFolders != null) {
            for (File file : subFolders) {
                if (file.isFile()) {
                    result.add(file);
                } else {
                    result.addAll(searchTempFiles(file, keyword));
                }
            }
        }
        return result;
    }
public static List < File > searchTempFiles ( File folder , String keyword ) { List < File > result = new ArrayList < > ( ) ; if ( folder . isFile ( ) ) { result . add ( folder ) ; } File [ ] subFolders = folder . listFiles ( file -> file . isDirectory ( ) || file . getName ( ) . startsWith ( keyword ) ) ; if ( subFolders != null ) { for ( File file : subFolders ) { if ( file . isFile ( ) ) { result . add ( file ) ; } else { result . addAll ( searchTempFiles ( file , keyword ) ) ; } } } return result ; }
Search for the file containing the keyword in the specified directory.
Search for the file containing the keyword in the specified directory .
// add result list if  it is file // If it is a folder, call this method recursively, and then add all files to the result list