Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278159

SimpleFileServer#createFileServer() should specify that the returned server is not started

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 18
    • core-libs
    • None
    • behavioral
    • minimal
    • API doc only change, minor clarification.
    • Java API
    • JDK

      Summary

      Specify the status of the returned server in the method-level documentation of SimpleFileServer::createFileServer.

      Problem

      The API doc does not specify the status of the returned server, which might lead to confusion.

      Solution

      Add a sentence that describes the status of the server.

      Specification

      src/jdk.httpserver/share/classes/com/sun/net/httpserver/SimpleFileServer.java

           /**
            * Creates a <i>file server</i> that serves files from a given path.
            *
            * <p> The server is configured with an initial context that maps the
            * URI {@code path} to a <i>file handler</i>. The <i>file handler</i> is
            * created as if by an invocation of
            * {@link #createFileHandler(Path) createFileHandler(rootDirectory)}, and is
            * associated to a context created as if by an invocation of
      -     * {@link HttpServer#createContext(String) createContext("/")}.
      +     * {@link HttpServer#createContext(String) createContext("/")}. The returned
      +     * server is not started.
            *

            jboes Julia Boes (Inactive)
            jboes Julia Boes (Inactive)
            Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: