Package org.codehaus.mojo.mrm.plugin
Class FileSystemServer
java.lang.Object
org.codehaus.mojo.mrm.plugin.FileSystemServer
A file system server.
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemServer(String name, int port, FileSystem fileSystem, String settingsServletPath) Creates a new file system server that will serve aFileSystemover HTTP on the specified port. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsures that the file system server is started (if already starting, will block until started, otherwise starts the file system server and blocks until started)voidfinish()Signal the file system server to shut down.intgetPort()Gets the port that the file system server is/will server on.Same asgetUrl(), but now for remote usersgetUrl()Gets the root url that the file system server is/will server on.booleanReturnstrueif and only if the file system server is finished.booleanReturnstrueif and only if the file system server is started.voidBlocks until the file system server has actually shut down.
-
Constructor Details
-
FileSystemServer
Creates a new file system server that will serve aFileSystemover HTTP on the specified port.- Parameters:
name- The name of the file system server thread.port- The port to server on or0to pick a random, but available, port.fileSystem- the file system to serve.
-
-
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()Returnstrueif and only if the file system server is finished.- Returns:
trueif and only if the file system server is finished.
-
isStarted
public boolean isStarted()Returnstrueif and only if the file system server is started.- Returns:
trueif 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.
-
getRemoteUrl
Same asgetUrl(), but now for remote users- Returns:
- the scheme + raw IP address + port
- Throws:
UnknownHostException- if the local host name could not be resolved into an address.
-