| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default port to use for the FTP server.
|
static java.lang.String |
DEFAULT_READ
The default user name that is allowed to read data.
|
static java.lang.String |
DEFAULT_ROOT
The default root directory name used by the FTP server.
|
static java.lang.String |
DEFAULT_WRITE
The default user name that is allowed to read and write data.
|
static java.lang.String |
DEFAULT_WRITE_PASSWORD
The default password of the user that is allowed to read and write data.
|
| Constructor and Description |
|---|
FtpServer() |
| Modifier and Type | Method and Description |
|---|---|
static Server |
createFtpServer(java.lang.String... args)
Create a new FTP server, but does not start it yet.
|
boolean |
getAllowOthers()
Check if remote connections are allowed.
|
java.lang.String |
getName()
Get the human readable name of the service.
|
int |
getPort()
Gets the port this service is listening on.
|
java.lang.String |
getType()
Get the human readable short name of the service.
|
java.lang.String |
getURL()
Get the URL of this service in a human readable form
|
void |
init(java.lang.String... args)
Initialize the service from command line options.
|
boolean |
isDaemon()
Check if a daemon thread should be used.
|
boolean |
isRunning(boolean traceError)
Check if the service is running.
|
void |
listen()
Listen for incoming connections.
|
static void |
main(java.lang.String... args)
When running without options, -tcp, -web, -browser,
and -pg are started.
Options are case sensitive. |
void |
runTool(java.lang.String... args)
Run the tool with the given output stream and arguments.
|
void |
setEventListener(FtpEventListener eventListener)
Set the event listener.
|
void |
start()
Start the service.
|
void |
stop()
Stop the service.
|
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOptionpublic static final int DEFAULT_PORT
public static final java.lang.String DEFAULT_ROOT
public static final java.lang.String DEFAULT_READ
public static final java.lang.String DEFAULT_WRITE
public static final java.lang.String DEFAULT_WRITE_PASSWORD
public static void main(java.lang.String... args)
throws java.sql.SQLException
| [-help] or [-?] | Print the list of options |
| [-web] | Start the web server with the H2 Console |
| [-webAllowOthers] | Allow other computers to connect |
| [-webPort <port>] | The port (default: 8082) |
| [-webSSL] | Use encrypted (HTTPS) connections |
| [-browser] | Start a browser and open a page to login to the web server |
| [-tcp] | Start the TCP server |
| [-tcpAllowOthers] | Allow other computers to connect |
| [-tcpPort <port>] | The port (default: 9092) |
| [-tcpSSL] | Use encrypted (SSL) connections |
| [-tcpPassword <pwd>] | The password for shutting down a TCP server |
| [-tcpShutdown "<url>"] | Stop the TCP server; example: tcp://localhost:9094 |
| [-tcpShutdownForce] | Do not wait until all connections are closed |
| [-pg] | Start the PG server |
| [-pgAllowOthers] | Allow other computers to connect |
| [-pgPort <port>] | The port (default: 5435) |
| [-ftp] | Start the FTP server |
| [-ftpPort <port>] | The port (default: 8021) |
| [-ftpDir <dir>] | The base directory (default: ftp) |
| [-ftpRead <user>] | The user name for reading (default: guest) |
| [-ftpWrite <user>] | The user name for writing (default: sa) |
| [-ftpWritePassword <p>] | The write password (default: sa) |
| [-baseDir <dir>] | The base directory for H2 databases; for all servers |
| [-ifExists] | Only existing databases may be opened; for all servers |
| [-trace] | Print additional trace information; for all servers |
args - the command line argumentsjava.sql.SQLExceptionpublic void runTool(java.lang.String... args)
throws java.sql.SQLException
Toolpublic void listen()
Servicepublic void init(java.lang.String... args)
Servicepublic java.lang.String getURL()
Servicepublic int getPort()
Servicepublic void start()
Servicepublic void stop()
Servicepublic boolean isRunning(boolean traceError)
Servicepublic boolean getAllowOthers()
ServicegetAllowOthers in interface Servicepublic java.lang.String getType()
Servicepublic java.lang.String getName()
Servicepublic void setEventListener(FtpEventListener eventListener)
eventListener - the new listener, or null to de-registerpublic static Server createFtpServer(java.lang.String... args) throws java.sql.SQLException
Server server = FtpServer.createFtpServer(null).start();
args - the argument listjava.sql.SQLException