Polling a directory for files

2
We have got the code working but encountered a new problem. The location of the files is on a secure server. The path to the server is https://anydirectory But how can we submit the loginname and password? Or would the only way be installing a ftp server on the server? Regards, Ronald [EDIT] It uses basic authentication. But how to automaticly submit the inlogname and password.
asked
3 answers
0

How do you connect to the https? In Java? Various libraries available for that on internet.

answered
0

https has nothing to do with logins. Loading the proper certificates in the modeler should do the trick.

But if the server is asking for login information as well, you need to figure out which authentication protocol is used, http basic authentication for example.

update

How are you retrieving the files? If you use the HTTP protocol in combination with java.net stuff (sockets, http, url or something like that) you can just add the required login headers. For example something like:

URL url = new URL(“location address”);
URLConnection uc = url.openConnection();
String authorizationString = “Basic “ + Base64.encode(username+":"+password);
uc.setRequestProperty ("Authorization", authorizationString);
InputStream in = url.openStream();
answered
0

Hi Ronald. It is possible to script ftp sessions. See this link for some details. The command you want is like

ftp -s:login-details.txt www.yourftpserver.com

where login-details.txt contains the username and password as the first 2 lines, followed by other ftp commands as needed.

answered