Skip to content

Commit

Permalink
#11 minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Mar 15, 2023
1 parent b78dc5f commit 3bc4a23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ public static boolean quickstartXmlExists(@NotNull Resource webroot) {
}
}

public static void createQuickStartXml(@NotNull WebAppContext context) throws IOException {
/**
* Generate the Jetty QuickStart config file to current working directory.
* @param context Jetty webapp. The classpath scanning is only performed when
* the Jetty server actually starts; therefore you must start Jetty in order for this function to work properly.
* @throws IOException on I/O error
*/
public static void generateQuickStartXml(@NotNull WebAppContext context) throws IOException {
context.setAttribute(ExtraXmlDescriptorProcessor.class.getName(), new ExtraXmlDescriptorProcessor());
final String xml = new File("quickstart-web.xml").getAbsolutePath();
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(xml))) {
new QuickStartGeneratorConfiguration().generateQuickStartWebXml(context, out);
}
log.info("Created Jetty QuickStart configuration at " + xml + ". Place the file into src/main/resources/webapp/WEB-INF/quickstart-web.xml of your webapp and ");
log.info("Generated Jetty QuickStart configuration file at " + xml + ". Place the file into src/main/resources/webapp/WEB-INF/quickstart-web.xml of your webapp and ");
}

private static final Logger log = LoggerFactory.getLogger(JettyQuickStart.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void start() throws Exception {
log.debug("Jetty Server started");

if (createQuickStartXml) {
JettyQuickStart.createQuickStartXml(context);
JettyQuickStart.generateQuickStartXml(context);
}

final Duration startupDuration = Duration.ofMillis(System.currentTimeMillis() - startupMeasurementSince);
Expand Down Expand Up @@ -334,7 +334,7 @@ public VaadinBoot withQuickStartMode(@NotNull QuickStartMode quickStartMode) {
* @return this
*/
@NotNull
public VaadinBoot createQuickStartXml() {
public VaadinBoot generateQuickStartXml() {
createQuickStartXml = true;
return this;
}
Expand Down

0 comments on commit 3bc4a23

Please sign in to comment.