class DriveHelper {

    @Nullable
    public String generateSearchQuery(@Nullable String folderName,
                                      @Nullable String parentId,
                                      @Nullable String mimeType) {
        List<String> queryList = new ArrayList<>();
        if (folderName != null) {
            queryList.add(String.format("name = '%s'", folderName));
        }
        if (parentId != null) {
            queryList.add(String.format("'%s' in parents", parentId));
        }
        if (mimeType != null) {
            queryList.add(String.format("mimeType = '%s'", mimeType));
        }

        if (queryList.isEmpty()) {
            return null;
        }

        // this query prevents siteName searching the deleted files
        queryList.add("trashed = false");

        StringBuilder query = new StringBuilder(queryList.get(0));
        for (int i = 1; i < queryList.size(); i++) {
            query.append(" and ").append(queryList.get(i));
        }

        return query.toString();
    }

      DriveHelper(@NonNull GoogleAccountCredential credential,
                @NonNull HttpTransport transport,
                @NonNull JsonFactory jsonFactory);
      DriveHelper(DriveService driveService);

}