D
ducnbyu
Hi all,
There is a set of zip files available on the Web via http (also
available via ftp) for public consuption that I would like to
programmatically read directly without having to download to local
storage first. For productivity reasons as well as reduction of
consumption/maintenance of local storage as some of them are quite
large.
This is basically what I tried (all of the below tried with http with
same results)...
1) ZipFile zf = new ZipFile("ftp://...");
result: ZipException "The filename, directory name, or volume label
syntax is incorrect"
2) ZipFile zf = new ZipFile(new File(new URI("ftp://...")));
result: File constructor throws IllegalArgumentException "URI Scheme is
not file"
Seems ZipFile constructors only take a string or File and File
apparently only takes URI's that resolve to "local" paths.
3) is = new ZipInputStream((new URL("ftp://...")).openStream());
result: IOException UnknownHostException... "www.xyz.abc"
4) is = new ZipInputStream((new URL("ftp://...")).openConnection(new
Proxy(Proxy.Type.HTTP, new InetSocketAddress("<proxy host from my
IExplorer>", <port number from my IE>) )).getInputStream());
result: IOException FileNotFound... "ftp://..." (This exception occurs
faster, in debug mode, than the others if that's useful.)
Should I continue to pursue any of these such as trying #3 outside of a
firewall, as in perhaps I'm not forming the proxy correctly in #4? I
ask because I will have to install a bunch of stuff at home to try it,
but only if what I'm trying to do sounds possible to you all? Or am I
stuck with having to download first?
The obvious workaround is to programmatically download, read, delete,
but I'd like to streamline a bit if possible since I only need a subset
of the contents of the zip archives. FWIW, the application reads
locally stored zip files successfully.
Thanks for your thoughts.
There is a set of zip files available on the Web via http (also
available via ftp) for public consuption that I would like to
programmatically read directly without having to download to local
storage first. For productivity reasons as well as reduction of
consumption/maintenance of local storage as some of them are quite
large.
This is basically what I tried (all of the below tried with http with
same results)...
1) ZipFile zf = new ZipFile("ftp://...");
result: ZipException "The filename, directory name, or volume label
syntax is incorrect"
2) ZipFile zf = new ZipFile(new File(new URI("ftp://...")));
result: File constructor throws IllegalArgumentException "URI Scheme is
not file"
Seems ZipFile constructors only take a string or File and File
apparently only takes URI's that resolve to "local" paths.
3) is = new ZipInputStream((new URL("ftp://...")).openStream());
result: IOException UnknownHostException... "www.xyz.abc"
4) is = new ZipInputStream((new URL("ftp://...")).openConnection(new
Proxy(Proxy.Type.HTTP, new InetSocketAddress("<proxy host from my
IExplorer>", <port number from my IE>) )).getInputStream());
result: IOException FileNotFound... "ftp://..." (This exception occurs
faster, in debug mode, than the others if that's useful.)
Should I continue to pursue any of these such as trying #3 outside of a
firewall, as in perhaps I'm not forming the proxy correctly in #4? I
ask because I will have to install a bunch of stuff at home to try it,
but only if what I'm trying to do sounds possible to you all? Or am I
stuck with having to download first?
The obvious workaround is to programmatically download, read, delete,
but I'd like to streamline a bit if possible since I only need a subset
of the contents of the zip archives. FWIW, the application reads
locally stored zip files successfully.
Thanks for your thoughts.