How to connect to an FTP Server with Java?

without using any 3rd party libraries?

This is the code I have..
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
 
public class FTPConnector {
 
    private static final String username = "myusername";
    private static final String password = "mypassword";
 
    public static void main(String[] args) throws IOException {
        final URL url = new URL("ftp://" + username + ":" + password + "@ftp.somewhere.net/");
        final URLConnection connection = url.openConnection();
        connection.connect();
        final InputStream inputStream = connection.getInputStream();
        int read;
        while ((read = inputStream.read()) != -1) {
            System.out.print((char) read);
        }
        inputStream.close();
    }
}

And the output will be something like..
drwxrwxrwx   1 user     group           0 Jul 22 08:44 foldername
drwxrwxrwx   1 user     group           0 Nov 23 11:02 anotherfolder
drwxrwxrwx   1 user     group           0 Dec 26  2015 somefolder