Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use FDT without CLI #32

Open
lucashmsilva opened this issue Sep 3, 2018 · 1 comment
Open

How to use FDT without CLI #32

lucashmsilva opened this issue Sep 3, 2018 · 1 comment

Comments

@lucashmsilva
Copy link

Hi, is there any way I can use the FDT classes through a Java program without having to use a command line interface to invoke the JAR file?

I tried this:

public class Main {

	public static void main(String [] args) {
		String [] arg = {"-c 192.168.0.4 -d C:\\Users\\Remote\\Documents\\ /home/local/bigFile.txt"};
		try {
			FDT.main(arg);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

But, no matter which command arg I pass, the default server is started:

2018-09-02 21:05:25 INFO lia.util.net.copy.FDT main

FDT [ 0.26.1-201708081830 ] STARTED ...


2018-09-02 21:05:25 INFO lia.util.net.common.Config <init> Using lia.util.net.copy.PosixFSFileChannelProviderFactory as FileChannelProviderFactory
2018-09-02 21:05:25 INFO lia.util.net.common.Config <init> FDT started in server mode
2018-09-02 21:05:25 INFO lia.util.net.copy.FDT main FDT uses *blocking* I/O mode.
READY
2018-09-02 21:05:25 INFO lia.util.net.copy.FDTServer doWork FDTServer start listening on port: 54321
@erbalazs
Copy link

Hi!

It works for me just fine. Your example is not a proper String array. Use it like this:

String[] fdtParams = { "-c", "localhost", "-pull", "-md5", "-p", "9999" ... }; 

try {
	FDT.main(fdtParams);
} catch (Exception e) {
	e.printStackTrace();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants