Hi,
I have a requirement to transfer the file to remote systems.
I wanted to do it with the FileChannel and don't want to use FTPClient.
FileChannel ic = new FileInputStream(sourcePath).getChannel();
FileChannel oc = new FileOutputStream("\\\\117.254.24.154\\Endhiran").getChannel());
ic.transferTo(0, ic.size(), oc);
ic.close();
oc.close();
Application throws an exception when it reach FileChannel oc = new FileOutputStream("\\\\117.254.24.154\\Endhiran").getChannel()); with unavailable destination path.
There is no issues when the destinationpath is reachable.
I wanted to know why does it takes 4 minutes to throw exception when the destination path is not available.
Can anyone advice on how to make it throw exception immediately when the dest is not reachable?
Thanks in advance.
Thanks
Vinoth
I have a requirement to transfer the file to remote systems.
I wanted to do it with the FileChannel and don't want to use FTPClient.
FileChannel ic = new FileInputStream(sourcePath).getChannel();
FileChannel oc = new FileOutputStream("\\\\117.254.24.154\\Endhiran").getChannel());
ic.transferTo(0, ic.size(), oc);
ic.close();
oc.close();
Application throws an exception when it reach FileChannel oc = new FileOutputStream("\\\\117.254.24.154\\Endhiran").getChannel()); with unavailable destination path.
There is no issues when the destinationpath is reachable.
I wanted to know why does it takes 4 minutes to throw exception when the destination path is not available.
Can anyone advice on how to make it throw exception immediately when the dest is not reachable?
Thanks in advance.
Thanks
Vinoth