Java ipfs API connection problem

IPFS ipfs = new IPFS("/ip4/");

I built a private network,
When establishing a connection, how to make a public gateway for the private network so that there is no single point of failure when accessing resources later.The above connection string specifies the public gateway for the private network. Not a connection to a particular node.
For example, like public network pain, access resources.