@@ -106,7 +106,7 @@ public final class Indexer {
106
106
private static final Set <String > defaultProjects = new TreeSet <>();
107
107
private static final ArrayList <String > zapCache = new ArrayList <>();
108
108
private static RuntimeEnvironment env = null ;
109
- private static String host = null ;
109
+ private static String webappURI = null ;
110
110
111
111
private static OptionParser optParser = null ;
112
112
private static boolean verbose = false ;
@@ -238,7 +238,7 @@ public static void main(String argv[]) {
238
238
RepositoryFactory .initializeIgnoredNames (env );
239
239
240
240
if (noindex ) {
241
- getInstance ().sendToConfigHost (env , host );
241
+ getInstance ().sendToConfigHost (env , webappURI );
242
242
writeConfigToFile (env , configFilename );
243
243
System .exit (0 );
244
244
}
@@ -285,11 +285,11 @@ public static void main(String argv[]) {
285
285
// from project-less config to one with projects), set the property
286
286
// so that the 'project/indexed' messages
287
287
// emitted during indexing do not cause validation error.
288
- if (addProjects && host != null ) {
288
+ if (addProjects && webappURI != null ) {
289
289
try {
290
- IndexerUtil .enableProjects (host );
290
+ IndexerUtil .enableProjects (webappURI );
291
291
} catch (Exception e ) {
292
- LOGGER .log (Level .SEVERE , "Mis-configuration of webapp host " , e );
292
+ LOGGER .log (Level .SEVERE , "Mis-configuration of webapp webappURI " , e );
293
293
System .err .println ("Couldn't notify the webapp: " + e .getLocalizedMessage ());
294
294
}
295
295
}
@@ -316,11 +316,11 @@ listFiles, createDict, subFiles, new ArrayList(repositories),
316
316
317
317
// Finally ping webapp to refresh indexes in the case of partial reindex
318
318
// or send new configuration to the web application in the case of full reindex.
319
- if (host != null ) {
319
+ if (webappURI != null ) {
320
320
if (!subFiles .isEmpty ()) {
321
- getInstance ().refreshSearcherManagers (env , subFiles , host );
321
+ getInstance ().refreshSearcherManagers (env , subFiles , webappURI );
322
322
} else {
323
- getInstance ().sendToConfigHost (env , host );
323
+ getInstance ().sendToConfigHost (env , webappURI );
324
324
}
325
325
}
326
326
@@ -341,7 +341,7 @@ listFiles, createDict, subFiles, new ArrayList(repositories),
341
341
}
342
342
343
343
/**
344
- * Web address consisting of host and port of a web address
344
+ * Web address consisting of webappURI and port of a web address
345
345
*/
346
346
public static class WebAddress {
347
347
private String host ;
@@ -360,18 +360,18 @@ public int getPort() {
360
360
}
361
361
362
362
/**
363
- * Parse a web address into its host and port components
363
+ * Parse a web address into its webappURI and port components
364
364
* This method along with the WebAddress class is used by OptionParser
365
365
* to validate user entry of a web address.
366
- * @param webAddr expected to be in the form host :port
366
+ * @param webAddr expected to be in the form webappURI :port
367
367
* @return WebAddress object
368
368
* @throws NumberFormatException or IllegalArgumentException
369
369
*/
370
370
public static WebAddress parseWebAddress (String webAddr ) {
371
371
String [] hp = webAddr .split (":" );
372
372
373
373
if (hp .length != 2 ) {
374
- throw new IllegalArgumentException ("WebAddress syntax error (expecting host :port)" );
374
+ throw new IllegalArgumentException ("WebAddress syntax error (expecting webappURI :port)" );
375
375
}
376
376
377
377
return new WebAddress (hp [0 ], hp [1 ]);
@@ -730,21 +730,21 @@ public static String[] parseOptions(String[] argv) throws ParseException {
730
730
cfg .setTabSize ((Integer )tabSize );
731
731
});
732
732
733
- parser .on ("-U" , "--host " , "=protocol://host :port/contextPath" ,
734
- "Send the current configuration to the specified address " ).Do (webAddr -> {
735
- host = (String ) webAddr ;
733
+ parser .on ("-U" , "--uri " , "=protocol://webappURI :port/contextPath" ,
734
+ "Send the current configuration to the specified webappURI " ).Do (webAddr -> {
735
+ webappURI = (String ) webAddr ;
736
736
try {
737
- URI uri = new URI (host );
737
+ URI uri = new URI (webappURI );
738
738
String scheme = uri .getScheme ();
739
739
if (!scheme .equals ("http" ) && !scheme .equals ("https" )) {
740
- die ("URI '" + host + "' does not have HTTP/HTTPS scheme" );
740
+ die ("webappURI '" + webappURI + "' does not have HTTP/HTTPS scheme" );
741
741
}
742
742
} catch (URISyntaxException e ) {
743
- die ("URL '" + host + "' is not valid." );
743
+ die ("URL '" + webappURI + "' is not valid." );
744
744
}
745
745
746
746
env = RuntimeEnvironment .getInstance ();
747
- env .setConfigHost ( host );
747
+ env .setConfigURI ( webappURI );
748
748
}
749
749
);
750
750
@@ -804,8 +804,8 @@ public static String[] parseOptions(String[] argv) throws ParseException {
804
804
private static void checkConfiguration () {
805
805
env = RuntimeEnvironment .getInstance ();
806
806
807
- if (noindex && (env .getConfigHost () == null || env .getConfigHost ().isEmpty ())) {
808
- die ("Missing host URL" );
807
+ if (noindex && (env .getConfigURI () == null || env .getConfigURI ().isEmpty ())) {
808
+ die ("Missing webappURI URL" );
809
809
}
810
810
811
811
if (repositories .size () > 0 && !cfg .isHistoryEnabled ()) {
0 commit comments