|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.util.Tool
org.h2.dev.ftp.server.FtpServer
public class FtpServer
Small FTP Server. Intended for ad-hoc networks in a secure environment. Remote connections are possible. See also http://cr.yp.to/ftp.html http://www.ftpguide.com/
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.h2.util.Tool |
|---|
out |
| Constructor Summary | |
|---|---|
FtpServer()
|
|
| Method Summary | |
|---|---|
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. |
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. |
| Methods inherited from class org.h2.util.Tool |
|---|
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOption |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public FtpServer()
| Method Detail |
|---|
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 connect 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 arguments
java.sql.SQLException
public void runTool(java.lang.String... args)
throws java.sql.SQLException
Tool
runTool in class Toolargs - the argument list
java.sql.SQLExceptionpublic void listen()
Service
listen in interface Servicepublic void init(java.lang.String... args)
Service
init in interface Serviceargs - the command line optionspublic java.lang.String getURL()
Service
getURL in interface Servicepublic int getPort()
Service
getPort in interface Servicepublic void start()
Service
start in interface Servicepublic void stop()
Service
stop in interface Servicepublic boolean isRunning(boolean traceError)
Service
isRunning in interface ServicetraceError - if errors should be written
public boolean getAllowOthers()
Service
getAllowOthers in interface Servicepublic java.lang.String getType()
Service
getType in interface Servicepublic java.lang.String getName()
Service
getName in interface Servicepublic void setEventListener(FtpEventListener eventListener)
eventListener - the new listener, or null to de-register
public static Server createFtpServer(java.lang.String... args)
throws java.sql.SQLException
Server server = FtpServer.createFtpServer(null).start();
args - the argument list
java.sql.SQLExceptionpublic boolean isDaemon()
Service
isDaemon in interface Service
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||