Good day to all.
I developed in Pl/sql environment to OracleForms a java source in order to copy form a url to a file system location an object ( in my case a pdf file) .
The code is:
public static void copy_file_from_URL(int[] rcode, String[] msg, String fromURL, String toFileName) {
try {
URL url = new URL(fromURL);
URLConnection connection = url.openConnection();
InputStream stream = connection.getInputStream();
Whith the instruction "connection.getInputStream()", I received the following error:
java.net.ProtocolException: Server redirected too many times (20)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1446).
I found on the web the solution to add as the first statement line this:
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
It works fine since JDK1.6, but however, In PLSQL I did not have the CookieHandler object because i have in PLSQL the java version " 1.4.2_14 " .
How can i do ?
Is there some code that can do the same operations of the Cookiehandler?
Thank you in advance.
Message was edited by: Costanzo Tartaglia