• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

electrode-io / electrode-native / 7592

29 Apr 2026 07:06PM UTC coverage: 56.607% (-11.2%) from 67.836%
7592

push

Azure Pipelines

web-flow
Merge pull request #1925 from electrode-io/npm-packages-security-audit-fixes

Fixed critical CVE for npm packages

3601 of 7766 branches covered (46.37%)

Branch coverage included in aggregate %.

9 of 10 new or added lines in 5 files covered. (90.0%)

1659 existing lines in 113 files now uncovered.

9426 of 15247 relevant lines covered (61.82%)

523.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.52
/ern-api-gen/src/languages/AndroidClientCodegen.ts
1
/* tslint:disable:variable-name */
2
import CliOption from '../CliOption';
2✔
3
import CodegenConstants from '../CodegenConstants';
2✔
4
import CodegenType from '../CodegenType';
2✔
5
import SupportingFile from '../SupportingFile';
2✔
6
import { ArrayProperty, MapProperty } from '../models/properties';
2✔
7
import StringUtils from '../java/StringUtils';
2✔
8
import { log } from 'ern-core';
2✔
9
import File from '../java/File';
2✔
10
import { newHashMap, newHashSet } from '../java/javaUtil';
2✔
11
import DefaultCodegen from '../DefaultCodegen';
2✔
12
import { parseBoolean } from '../java/BooleanHelper';
2✔
13
import path from 'path';
2✔
14

15
export default class AndroidClientCodegen extends DefaultCodegen {
2✔
16
  public static readonly USE_ANDROID_MAVEN_GRADLE_PLUGIN =
2✔
17
    'useAndroidMavenGradlePlugin';
18
  public invokerPackage = 'io.swagger.client';
244✔
19
  public groupId = 'io.swagger';
244✔
20
  public artifactId = 'swagger-android-client';
244✔
21
  public artifactVersion = '1.0.0';
244✔
22
  public projectFolder = 'src/main';
244✔
23

24
  public useAndroidMavenGradlePlugin = true;
244✔
25
  public requestPackage = 'io.swagger.client.request';
244✔
26
  public authPackage = 'io.swagger.client.auth';
244✔
27
  public gradleWrapperPackage = 'gradle.wrapper';
244✔
28
  public apiDocPath = 'docs/';
244✔
29
  public modelDocPath = 'docs/';
244✔
30
  public __outputFolder = 'generated-code/android';
244✔
31
  public __languageSpecificPrimitives = newHashSet(
244✔
32
    'String',
33
    'boolean',
34
    'Boolean',
35
    'Double',
36
    'Integer',
37
    'Long',
38
    'Float',
39
    'byte[]',
40
    'Bundle',
41
  );
42
  public __apiPackage = 'io.swagger.client.api';
244✔
43
  public __modelPackage = 'io.swagger.client.model';
244✔
44
  public __embeddedTemplateDir = 'android';
244✔
45
  public __templateDir = 'android';
244✔
46
  public __supportedLibraries = newHashMap(
244✔
47
    ['volley', 'HTTP client: Volley 1.0.19 (default)'],
48
    [
49
      'httpclient',
50
      'HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.',
51
    ],
52
  );
53

54
  public sourceFolder;
55

56
  constructor() {
57
    super();
244✔
58
    this.sourceFolder = this.projectFolder + '/java';
244✔
59
    this.__modelTemplateFiles.put('model.mustache', '.java');
244✔
60
    this.__apiTemplateFiles.put('api.mustache', '.java');
244✔
61
    this.setReservedWordsLowerCase([
244✔
62
      'localVarPostBody',
63
      'localVarPath',
64
      'localVarQueryParams',
65
      'localVarHeaderParams',
66
      'localVarFormParams',
67
      'localVarContentTypes',
68
      'localVarContentType',
69
      'localVarResponse',
70
      'localVarBuilder',
71
      'authNames',
72
      'basePath',
73
      'apiInvoker',
74
      'abstract',
75
      'continue',
76
      'for',
77
      'new',
78
      'switch',
79
      'assert',
80
      'default',
81
      'if',
82
      'package',
83
      'synchronized',
84
      'boolean',
85
      'do',
86
      'goto',
87
      'private',
88
      'this',
89
      'break',
90
      'double',
91
      'implements',
92
      'protected',
93
      'throw',
94
      'byte',
95
      'else',
96
      'import',
97
      'public',
98
      'throws',
99
      'case',
100
      'enum',
101
      'instanceof',
102
      'return',
103
      'transient',
104
      'catch',
105
      'extends',
106
      'int',
107
      'short',
108
      'try',
109
      'char',
110
      'final',
111
      'interface',
112
      'static',
113
      'void',
114
      'class',
115
      'finally',
116
      'long',
117
      'strictfp',
118
      'volatile',
119
      'const',
120
      'float',
121
      'native',
122
      'super',
123
      'while',
124
    ]);
125
    this.__instantiationTypes.put('array', 'ArrayList');
244✔
126
    this.__instantiationTypes.put('map', 'HashMap');
244✔
127
    this.__typeMapping.put('date', 'Date');
244✔
128
    this.__typeMapping.put('file', 'File');
244✔
129
    this.__typeMapping.put('object', 'Bundle');
244✔
130
  }
131

132
  public initalizeCliOptions() {
133
    super.initalizeCliOptions();
244✔
134
    this.__cliOptions.push(
244✔
135
      new CliOption(
136
        CodegenConstants.MODEL_PACKAGE,
137
        CodegenConstants.MODEL_PACKAGE_DESC,
138
      ),
139
    );
140
    this.__cliOptions.push(
244✔
141
      new CliOption(
142
        CodegenConstants.API_PACKAGE,
143
        CodegenConstants.API_PACKAGE_DESC,
144
      ),
145
    );
146
    this.__cliOptions.push(
244✔
147
      new CliOption(
148
        CodegenConstants.INVOKER_PACKAGE,
149
        CodegenConstants.INVOKER_PACKAGE_DESC,
150
      ),
151
    );
152
    this.__cliOptions.push(
244✔
153
      new CliOption(
154
        CodegenConstants.GROUP_ID,
155
        'groupId for use in the generated build.gradle and pom.xml',
156
      ),
157
    );
158
    this.__cliOptions.push(
244✔
159
      new CliOption(
160
        CodegenConstants.ARTIFACT_ID,
161
        'artifactId for use in the generated build.gradle and pom.xml',
162
      ),
163
    );
164
    this.__cliOptions.push(
244✔
165
      new CliOption(
166
        CodegenConstants.ARTIFACT_VERSION,
167
        'artifact version for use in the generated build.gradle and pom.xml',
168
      ),
169
    );
170
    this.__cliOptions.push(
244✔
171
      new CliOption(
172
        CodegenConstants.SOURCE_FOLDER,
173
        CodegenConstants.SOURCE_FOLDER_DESC,
174
      ),
175
    );
176
    this.__cliOptions.push(
244✔
177
      CliOption.newBoolean(
178
        AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN,
179
        'A flag to toggle android-maven gradle plugin.',
180
      ).defaultValue('true'),
181
    );
182
    const library = new CliOption(
244✔
183
      CodegenConstants.LIBRARY,
184
      'library template (sub-template) to use',
185
    );
186
    library.setEnum(this.__supportedLibraries);
244✔
187
    this.__cliOptions.push(library);
244✔
188
  }
189

190
  public getTag() {
191
    return CodegenType.CLIENT;
×
192
  }
193

194
  public getName() {
195
    return 'android';
222✔
196
  }
197

198
  public getHelp() {
199
    return 'Generates an Android client library.';
×
200
  }
201

202
  public escapeReservedWord(name) {
203
    return '_' + name;
×
204
  }
205

206
  public apiFileFolder() {
207
    return (
137✔
208
      this.__outputFolder +
209
      path.sep +
210
      this.sourceFolder +
211
      path.sep +
212
      this.apiPackage().split('.').join(File.separator)
213
    );
214
  }
215

216
  public modelFileFolder() {
217
    return (
80✔
218
      this.__outputFolder +
219
      path.sep +
220
      this.sourceFolder +
221
      path.sep +
222
      this.modelPackage().split('.').join(File.separator)
223
    );
224
  }
225

226
  public apiDocFileFolder() {
227
    return (this.__outputFolder + path.sep + this.apiDocPath)
29✔
228
      .split(path.sep)
229
      .join(File.separator);
230
  }
231

232
  public modelDocFileFolder() {
233
    return (this.__outputFolder + path.sep + this.modelDocPath)
45✔
234
      .split(path.sep)
235
      .join(File.separator);
236
  }
237

238
  public toApiDocFilename(name) {
239
    return this.toApiName(name);
29✔
240
  }
241

242
  public toModelDocFilename(name) {
243
    return this.toModelName(name);
45✔
244
  }
245

246
  public getTypeDeclaration(p) {
247
    if (p != null && p instanceof ArrayProperty) {
1,974✔
248
      const ap = p;
203✔
249
      const inner = ap.getItems();
203✔
250
      return (
203✔
251
        this.getSwaggerType(p) + '<' + this.getTypeDeclaration(inner) + '>'
252
      );
253
    } else if (p != null && p instanceof MapProperty) {
1,771✔
254
      const mp = p;
16✔
255
      const inner = mp.getAdditionalProperties();
16✔
256
      return (
16✔
257
        this.getSwaggerType(p) +
258
        '<String, ' +
259
        this.getTypeDeclaration(inner) +
260
        '>'
261
      );
262
    }
263
    return super.getTypeDeclaration(p);
1,755✔
264
  }
265

266
  public getSwaggerType(p) {
267
    const swaggerType = super.getSwaggerType(p);
5,559✔
268
    let type = null;
5,559✔
269
    if (this.__typeMapping.containsKey(swaggerType)) {
5,559✔
270
      type = this.__typeMapping.get(swaggerType);
4,333✔
271
      if (
4,333✔
272
        this.__languageSpecificPrimitives.contains(type) ||
7,257✔
273
        (type! as string).indexOf('.') >= 0 ||
274
        type === 'Map' ||
275
        type === 'List' ||
276
        type === 'File' ||
277
        type === 'Date'
278
      ) {
279
        return type;
4,261✔
280
      }
281
    } else {
282
      type = swaggerType;
1,226✔
283
    }
284
    return this.toModelName(type);
1,298✔
285
  }
286

287
  public toVarName(name) {
288
    name = this.sanitizeName(name);
5,608✔
289
    name = name.replace(new RegExp('-', 'g'), '_');
5,608✔
290
    if (name.match('^[A-Z_]*$')) {
5,608!
291
      return name;
×
292
    }
293
    name = DefaultCodegen.camelize(name, true);
5,608✔
294
    if (this.isReservedWord(name) || name.match('^\\d.*')) {
5,608!
295
      name = this.escapeReservedWord(name);
×
296
    }
297
    return name;
5,608✔
298
  }
299

300
  public toParamName(name) {
301
    return this.toVarName(name);
308✔
302
  }
303

304
  public toModelName(name) {
305
    if (!StringUtils.isEmpty(this.modelNamePrefix)) {
2,364!
306
      name = this.modelNamePrefix + '_' + name;
×
307
    }
308
    if (!StringUtils.isEmpty(this.modelNameSuffix)) {
2,364!
309
      name = name + '_' + this.modelNameSuffix;
×
310
    }
311
    if (name.toUpperCase() === name) {
2,364✔
312
      return name;
12✔
313
    }
314
    name = DefaultCodegen.camelize(this.sanitizeName(name));
2,352✔
315
    if (this.isReservedWord(name)) {
2,352✔
316
      const modelName = 'Model' + name;
8✔
317
      log.warn(
8✔
318
        `${name} (reserved word) cannot be used as model name. Renamed to ${modelName}`,
319
      );
320
      return modelName;
8✔
321
    }
322
    if (name.match('^\\d.*')) {
2,344!
323
      const modelName = 'Model' + name;
×
324
      log.warn(
×
325
        `${name} (model name starts with number) cannot be used as model name. Renamed to ${modelName}`,
326
      );
327
      return modelName;
×
328
    }
329
    return name;
2,344✔
330
  }
331

332
  public toModelFilename(name) {
333
    return this.toModelName(name);
259✔
334
  }
335

336
  public setParameterExampleValue(p) {
337
    let example;
338
    if (p.defaultValue == null) {
308✔
339
      example = p.example;
299✔
340
    } else {
341
      example = p.defaultValue;
9✔
342
    }
343
    let type = p.baseType;
308✔
344
    if (type == null) {
308✔
345
      type = p.dataType;
208✔
346
    }
347
    if ('String' === type) {
308✔
348
      if (example == null) {
155✔
349
        example = p.paramName + '_example';
13✔
350
      }
351
      example = '"' + this.escapeText(example) + '"';
155✔
352
    } else if ('Integer' === type || 'Short' === type) {
153✔
353
      if (example == null) {
17✔
354
        example = '56';
4✔
355
      }
356
    } else if ('Long' === type) {
136✔
357
      if (example == null) {
36!
358
        example = '56';
×
359
      }
360
      example = example + 'L';
36✔
361
    } else if ('Float' === type) {
100!
362
      if (example == null) {
×
363
        example = '3.4';
×
364
      }
365
      example = example + 'F';
×
366
    } else if ('Double' === type) {
100✔
367
      example = '3.4';
32✔
368
      example = example + 'D';
32✔
369
    } else if ('Boolean' === type) {
68!
370
      if (example == null) {
×
371
        example = 'true';
×
372
      }
373
    } else if ('File' === type) {
68!
374
      if (example == null) {
×
375
        example = '/path/to/file';
×
376
      }
377
      example = 'new File("' + this.escapeText(example) + '")';
×
378
    } else if ('Date' === type) {
68!
379
      example = 'new Date()';
×
380
    } else if (!this.__languageSpecificPrimitives.contains(type)) {
68!
381
      example = 'new ' + type + '()';
68✔
382
    }
383
    if (example == null) {
308!
UNCOV
384
      example = 'null';
×
385
    } else if (p.isListContainer) {
308✔
386
      example = 'Arrays.asList(' + example + ')';
40✔
387
    } else if (p.isMapContainer) {
268!
388
      example = 'new HashMap()';
×
389
    }
390
    p.example = example;
308✔
391
  }
392

393
  public toOperationId(operationId) {
394
    if (StringUtils.isEmpty(operationId)) {
251!
395
      throw new Error('Empty method name (operationId) not allowed');
×
396
    }
397
    operationId = DefaultCodegen.camelize(this.sanitizeName(operationId), true);
251✔
398
    if (this.isReservedWord(operationId)) {
251!
399
      const newOperationId = DefaultCodegen.camelize(
×
400
        'call_' + operationId,
401
        true,
402
      );
403
      log.warn(
×
404
        `${operationId} (reserved word) cannot be used as method name. Renamed to ${newOperationId}`,
405
      );
406
      return newOperationId;
×
407
    }
408
    return operationId;
251✔
409
  }
410

411
  public processOpts() {
412
    super.processOpts();
36✔
413
    if (
36!
414
      this.__additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)
415
    ) {
416
      this.setInvokerPackage(
×
417
        this.__additionalProperties.get(CodegenConstants.INVOKER_PACKAGE),
418
      );
419
    } else {
420
      this.__additionalProperties.put(
36✔
421
        CodegenConstants.INVOKER_PACKAGE,
422
        this.invokerPackage,
423
      );
424
    }
425
    if (this.__additionalProperties.containsKey(CodegenConstants.GROUP_ID)) {
36✔
426
      this.setGroupId(
1✔
427
        this.__additionalProperties.get(CodegenConstants.GROUP_ID),
428
      );
429
    } else {
430
      this.__additionalProperties.put(CodegenConstants.GROUP_ID, this.groupId);
35✔
431
    }
432
    if (this.__additionalProperties.containsKey(CodegenConstants.ARTIFACT_ID)) {
36✔
433
      this.setArtifactId(
1✔
434
        this.__additionalProperties.get(CodegenConstants.ARTIFACT_ID),
435
      );
436
    } else {
437
      this.__additionalProperties.put(
35✔
438
        CodegenConstants.ARTIFACT_ID,
439
        this.artifactId,
440
      );
441
    }
442
    if (
36!
443
      this.__additionalProperties.containsKey(CodegenConstants.ARTIFACT_VERSION)
444
    ) {
445
      this.setArtifactVersion(
×
446
        this.__additionalProperties.get(CodegenConstants.ARTIFACT_VERSION),
447
      );
448
    } else {
449
      this.__additionalProperties.put(
36✔
450
        CodegenConstants.ARTIFACT_VERSION,
451
        this.artifactVersion,
452
      );
453
    }
454
    if (
36!
455
      this.__additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)
456
    ) {
457
      this.setSourceFolder(
×
458
        this.__additionalProperties.get(CodegenConstants.SOURCE_FOLDER),
459
      );
460
    }
461
    if (
36!
462
      this.__additionalProperties.containsKey(
463
        AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN,
464
      )
465
    ) {
466
      this.setUseAndroidMavenGradlePlugin(
×
467
        parseBoolean(
468
          this.__additionalProperties.get(
469
            AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN,
470
          ),
471
        ),
472
      );
473
    } else {
474
      this.__additionalProperties.put(
36✔
475
        AndroidClientCodegen.USE_ANDROID_MAVEN_GRADLE_PLUGIN,
476
        this.useAndroidMavenGradlePlugin,
477
      );
478
    }
479
    if (this.__additionalProperties.containsKey(CodegenConstants.LIBRARY)) {
36!
480
      this.setLibrary(
×
481
        this.__additionalProperties.get(CodegenConstants.LIBRARY),
482
      );
483
    }
484
    this.__additionalProperties.put('apiDocPath', this.apiDocPath);
36✔
485
    this.__additionalProperties.put('modelDocPath', this.modelDocPath);
36✔
486
    if (StringUtils.isEmpty(this.getLibrary())) {
36✔
487
      this.setLibrary('volley');
17✔
488
    } else {
489
      this.setLibrary(this.getLibrary());
19✔
490
    }
491
    const f =
492
      this[
36✔
493
        `addSupportingFilesFor${DefaultCodegen.camelize(this.getLibrary())}`
494
      ];
495
    if (f) {
36!
496
      f.call(this);
36✔
497
    }
498
  }
499

500
  public addSupportingForFilesHttpclient() {
501
    this.addSupportingFilesForHttpClient();
×
502
  }
503

504
  public addSupportingFilesForHttpClient() {
505
    this.__modelDocTemplateFiles.put('model_doc.mustache', '.md');
×
506
    this.__apiDocTemplateFiles.put('api_doc.mustache', '.md');
×
507
    this.__supportingFiles.push(
×
508
      new SupportingFile('README.mustache', '', 'README.md'),
509
    );
510
    this.__supportingFiles.push(
×
511
      new SupportingFile('pom.mustache', '', 'pom.xml'),
512
    );
513
    this.__supportingFiles.push(
×
514
      new SupportingFile('settings.gradle.mustache', '', 'settings.gradle'),
515
    );
516
    this.__supportingFiles.push(
×
517
      new SupportingFile('build.mustache', '', 'build.gradle'),
518
    );
519
    this.__supportingFiles.push(
×
520
      new SupportingFile(
521
        'manifest.mustache',
522
        this.projectFolder,
523
        'AndroidManifest.xml',
524
      ),
525
    );
526
    this.__supportingFiles.push(
×
527
      new SupportingFile(
528
        'apiInvoker.mustache',
529
        (this.sourceFolder + File.separator + this.invokerPackage)
530
          .split('.')
531
          .join(File.separator),
532
        'ApiInvoker.java',
533
      ),
534
    );
535
    this.__supportingFiles.push(
×
536
      new SupportingFile(
537
        'httpPatch.mustache',
538
        (this.sourceFolder + File.separator + this.invokerPackage)
539
          .split('.')
540
          .join(File.separator),
541
        'HttpPatch.java',
542
      ),
543
    );
544
    this.__supportingFiles.push(
×
545
      new SupportingFile(
546
        'jsonUtil.mustache',
547
        (this.sourceFolder + File.separator + this.invokerPackage)
548
          .split('.')
549
          .join(File.separator),
550
        'JsonUtil.java',
551
      ),
552
    );
553
    this.__supportingFiles.push(
×
554
      new SupportingFile(
555
        'apiException.mustache',
556
        (this.sourceFolder + File.separator + this.invokerPackage)
557
          .split('.')
558
          .join(File.separator),
559
        'ApiException.java',
560
      ),
561
    );
562
    this.__supportingFiles.push(
×
563
      new SupportingFile(
564
        'Pair.mustache',
565
        (this.sourceFolder + File.separator + this.invokerPackage)
566
          .split('.')
567
          .join(File.separator),
568
        'Pair.java',
569
      ),
570
    );
571
    this.__supportingFiles.push(
×
572
      new SupportingFile('git_push.sh.mustache', '', 'git_push.sh'),
573
    );
574
    this.__supportingFiles.push(
×
575
      new SupportingFile('gitignore.mustache', '', '.gitignore'),
576
    );
577
    this.__supportingFiles.push(
×
578
      new SupportingFile('gradlew.mustache', '', 'gradlew'),
579
    );
580
    this.__supportingFiles.push(
×
581
      new SupportingFile('gradlew.bat.mustache', '', 'gradlew.bat'),
582
    );
583
    this.__supportingFiles.push(
×
584
      new SupportingFile(
585
        'gradle-wrapper.properties.mustache',
586
        this.gradleWrapperPackage.split('.').join(File.separator),
587
        'gradle-wrapper.properties',
588
      ),
589
    );
590
    this.__supportingFiles.push(
×
591
      new SupportingFile(
592
        'gradle-wrapper.jar',
593
        this.gradleWrapperPackage.split('.').join(File.separator),
594
        'gradle-wrapper.jar',
595
      ),
596
    );
597
  }
598

599
  public addSupportingFilesForVolley() {
600
    this.__modelDocTemplateFiles.put('model_doc.mustache', '.md');
17✔
601
    this.__apiDocTemplateFiles.put('api_doc.mustache', '.md');
17✔
602
    this.__supportingFiles.push(
17✔
603
      new SupportingFile('README.mustache', '', 'README.md'),
604
    );
605
    this.__supportingFiles.push(
17✔
606
      new SupportingFile('git_push.sh.mustache', '', 'git_push.sh'),
607
    );
608
    this.__supportingFiles.push(
17✔
609
      new SupportingFile('gitignore.mustache', '', '.gitignore'),
610
    );
611
    this.__supportingFiles.push(
17✔
612
      new SupportingFile('pom.mustache', '', 'pom.xml'),
613
    );
614
    this.__supportingFiles.push(
17✔
615
      new SupportingFile('build.mustache', '', 'build.gradle'),
616
    );
617
    this.__supportingFiles.push(
17✔
618
      new SupportingFile(
619
        'manifest.mustache',
620
        this.projectFolder,
621
        'AndroidManifest.xml',
622
      ),
623
    );
624
    this.__supportingFiles.push(
17✔
625
      new SupportingFile(
626
        'apiInvoker.mustache',
627
        (this.sourceFolder + File.separator + this.invokerPackage)
628
          .split('.')
629
          .join(File.separator),
630
        'ApiInvoker.java',
631
      ),
632
    );
633
    this.__supportingFiles.push(
17✔
634
      new SupportingFile(
635
        'jsonUtil.mustache',
636
        (this.sourceFolder + File.separator + this.invokerPackage)
637
          .split('.')
638
          .join(File.separator),
639
        'JsonUtil.java',
640
      ),
641
    );
642
    this.__supportingFiles.push(
17✔
643
      new SupportingFile(
644
        'apiException.mustache',
645
        (this.sourceFolder + File.separator + this.invokerPackage)
646
          .split('.')
647
          .join(File.separator),
648
        'ApiException.java',
649
      ),
650
    );
651
    this.__supportingFiles.push(
17✔
652
      new SupportingFile(
653
        'Pair.mustache',
654
        (this.sourceFolder + File.separator + this.invokerPackage)
655
          .split('.')
656
          .join(File.separator),
657
        'Pair.java',
658
      ),
659
    );
660
    this.__supportingFiles.push(
17✔
661
      new SupportingFile(
662
        'request/getrequest.mustache',
663
        (this.sourceFolder + File.separator + this.requestPackage)
664
          .split('.')
665
          .join(File.separator),
666
        'GetRequest.java',
667
      ),
668
    );
669
    this.__supportingFiles.push(
17✔
670
      new SupportingFile(
671
        'request/postrequest.mustache',
672
        (this.sourceFolder + File.separator + this.requestPackage)
673
          .split('.')
674
          .join(File.separator),
675
        'PostRequest.java',
676
      ),
677
    );
678
    this.__supportingFiles.push(
17✔
679
      new SupportingFile(
680
        'request/putrequest.mustache',
681
        (this.sourceFolder + File.separator + this.requestPackage)
682
          .split('.')
683
          .join(File.separator),
684
        'PutRequest.java',
685
      ),
686
    );
687
    this.__supportingFiles.push(
17✔
688
      new SupportingFile(
689
        'request/deleterequest.mustache',
690
        (this.sourceFolder + File.separator + this.requestPackage)
691
          .split('.')
692
          .join(File.separator),
693
        'DeleteRequest.java',
694
      ),
695
    );
696
    this.__supportingFiles.push(
17✔
697
      new SupportingFile(
698
        'request/patchrequest.mustache',
699
        (this.sourceFolder + File.separator + this.requestPackage)
700
          .split('.')
701
          .join(File.separator),
702
        'PatchRequest.java',
703
      ),
704
    );
705
    this.__supportingFiles.push(
17✔
706
      new SupportingFile(
707
        'auth/apikeyauth.mustache',
708
        (this.sourceFolder + File.separator + this.authPackage)
709
          .split('.')
710
          .join(File.separator),
711
        'ApiKeyAuth.java',
712
      ),
713
    );
714
    this.__supportingFiles.push(
17✔
715
      new SupportingFile(
716
        'auth/httpbasicauth.mustache',
717
        (this.sourceFolder + File.separator + this.authPackage)
718
          .split('.')
719
          .join(File.separator),
720
        'HttpBasicAuth.java',
721
      ),
722
    );
723
    this.__supportingFiles.push(
17✔
724
      new SupportingFile(
725
        'auth/authentication.mustache',
726
        (this.sourceFolder + File.separator + this.authPackage)
727
          .split('.')
728
          .join(File.separator),
729
        'Authentication.java',
730
      ),
731
    );
732
    this.__supportingFiles.push(
17✔
733
      new SupportingFile('gradlew.mustache', '', 'gradlew'),
734
    );
735
    this.__supportingFiles.push(
17✔
736
      new SupportingFile('gradlew.bat.mustache', '', 'gradlew.bat'),
737
    );
738
    this.__supportingFiles.push(
17✔
739
      new SupportingFile(
740
        'gradle-wrapper.properties.mustache',
741
        this.gradleWrapperPackage.split('.').join(File.separator),
742
        'gradle-wrapper.properties',
743
      ),
744
    );
745
    this.__supportingFiles.push(
17✔
746
      new SupportingFile(
747
        'gradle-wrapper.jar',
748
        this.gradleWrapperPackage.split('.').join(File.separator),
749
        'gradle-wrapper.jar',
750
      ),
751
    );
752
  }
753

754
  public getUseAndroidMavenGradlePlugin() {
755
    return this.useAndroidMavenGradlePlugin;
×
756
  }
757

758
  public setUseAndroidMavenGradlePlugin(useAndroidMavenGradlePlugin) {
759
    this.useAndroidMavenGradlePlugin = useAndroidMavenGradlePlugin;
×
760
  }
761

762
  public setInvokerPackage(invokerPackage) {
763
    this.invokerPackage = invokerPackage;
×
764
  }
765

766
  public setGroupId(groupId) {
767
    this.groupId = groupId;
2✔
768
  }
769

770
  public setArtifactId(artifactId) {
771
    this.artifactId = artifactId;
2✔
772
  }
773

774
  public setArtifactVersion(artifactVersion) {
775
    this.artifactVersion = artifactVersion;
×
776
  }
777

778
  public setSourceFolder(sourceFolder) {
779
    this.sourceFolder = sourceFolder;
×
780
  }
781

782
  public escapeQuotationMark(input) {
783
    return input.split('"').join('');
467✔
784
  }
785

786
  public escapeUnsafeCharacters(input) {
787
    return input.split('*/').join('*_/').split('/*').join('/_*');
2,537✔
788
  }
789
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc