Class FileSystemServer

java.lang.Object
org.codehaus.mojo.mrm.plugin.FileSystemServer

public class FileSystemServer extends Object
A file system server.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileSystemServer(String name, int port, String contextPath, FileSystem fileSystem, boolean debugServer)
    Creates a new file system server that will serve a FileSystem over HTTP on the specified port.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Ensures that the file system server is started (if already starting, will block until started, otherwise starts the file system server and blocks until started)
    void
    Signal the file system server to shut down.
    int
    Gets the port that the file system server is/will server on.
    Gets the root url that the file system server is/will server on.
    boolean
    Returns true if and only if the file system server is finished.
    boolean
    Returns true if and only if the file system server is started.
    void
    Blocks until the file system server has actually shut down.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileSystemServer

      public FileSystemServer(String name, int port, String contextPath, FileSystem fileSystem, boolean debugServer)
      Creates a new file system server that will serve a FileSystem over HTTP on the specified port.
      Parameters:
      name - The name of the file system server thread.
      port - The port to server on or 0 to pick a random, but available, port.
      contextPath - The root context path for server
      fileSystem - the file system to serve.
      debugServer - the server debug mode
  • Method Details

    • ensureStarted

      public void ensureStarted() throws org.apache.maven.plugin.MojoExecutionException
      Ensures that the file system server is started (if already starting, will block until started, otherwise starts the file system server and blocks until started)
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the file system server could not be started.
    • isFinished

      public boolean isFinished()
      Returns true if and only if the file system server is finished.
      Returns:
      true if and only if the file system server is finished.
    • isStarted

      public boolean isStarted()
      Returns true if and only if the file system server is started.
      Returns:
      true if and only if the file system server is started.
    • finish

      public void finish()
      Signal the file system server to shut down.
    • waitForFinished

      public void waitForFinished() throws InterruptedException
      Blocks until the file system server has actually shut down.
      Throws:
      InterruptedException - if interrupted.
    • getPort

      public int getPort()
      Gets the port that the file system server is/will server on.
      Returns:
      the port that the file system server is/will server on.
    • getUrl

      public String getUrl()
      Gets the root url that the file system server is/will server on.
      Returns:
      the root url that the file system server is/will server on.