I am writing a simple app in Java using JFrame GUI. In GUI I have 2 fields (for ip and the folder) and 1 spinner for port number I want to connect to. I can connect to my server http://147.230.75.240:8080/. But that path is completely empty and I need to go deeper to http://147.230.75.240:8080/sti. But I don't know how to achieve that. As I said there are no folders in the default connection. How can I connect specifically to this part? You can see my code below:
private void connectButtonActionPerformed(java.awt.event.ActionEvent evt) {
Socket socket = null;
String ip;
int port;
String folder;
ip = ipField.getText();
port = (int) portField.getValue();
folder = folderField.getText();
try {
File[] files = new File(folder).listFiles();
System.out.println(files);
socket = new Socket(InetAddress.getByName(ip), port);
connectionStatus.setText("Connected");
} catch (IOException ex) {
Logger.getLogger(ConnectForm.class.getName()).log(Level.SEVERE, null, ex);
}
}
files in this case return null.