Package org.codehaus.mojo.mrm.plugin
Class FileSystemServer
java.lang.Object
org.codehaus.mojo.mrm.plugin.FileSystemServer
A file system server.
-
Constructor Summary
ConstructorDescriptionFileSystemServer
(String name, int port, String contextPath, FileSystem fileSystem, boolean debugServer) Creates a new file system server that will serve aFileSystem
over HTTP on the specified port. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
finish()
Signal the file system server to shut down.int
getPort()
Gets the port that the file system server is/will server on.getUrl()
Gets the root url that the file system server is/will server on.boolean
Returnstrue
if and only if the file system server is finished.boolean
Returnstrue
if and only if the file system server is started.void
Blocks until the file system server has actually shut down.
-
Constructor Details
-
FileSystemServer
public FileSystemServer(String name, int port, String contextPath, FileSystem fileSystem, boolean debugServer) Creates a new file system server that will serve aFileSystem
over HTTP on the specified port.- Parameters:
name
- The name of the file system server thread.port
- The port to server on or0
to pick a random, but available, port.contextPath
- The root context path for serverfileSystem
- the file system to serve.debugServer
- the server debug mode
-
-
Method Details
-
ensureStarted
public void ensureStarted() throws org.apache.maven.plugin.MojoExecutionExceptionEnsures 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()Returnstrue
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()Returnstrue
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
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
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.
-