Hi,
I have mapped G:\ to a directory on another PC in network, which has all permissions set for 'everyone'.
I have pointed the mapped drive to be tftpServer directory.
I am trying to upload a config file from my controller to this tftp server.
1. To check if the directory is a mapped directory, i am using: dir.getCanonicalFile().equals(dir).. this returns true for mapped drive.
This is the code to check for the write permissions:
// Check saveDirectory is writable,--
if (!dir.canWrite()) {
throw new IllegalArgumentException("Not writable: " + saveDirectory);
}
For the mapped directory 'canWrite' is returned false, even though the file permissions look ok. I can manually copy a file to the mapped drive,
modify the file on the mapped drive.
And checked on Google, could not find any way to check if canonical File is writable. How can I make sure the canonical file/dir is writable?
2. Removed the canWrite check, and looks like the tftpServer is unable to read from the mapped drive.
When I run CLI to upload the file, I see TFTP write requests in ethereal but no acknowledgement from tftp server.
I see this exception in the log:
java.io.FileNotFoundException: G:\one.txt (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at com.globalros.tftp.FileSystem.getOutputStream(FileSystem.java:67)
at com.globalros.tftp.server.TFTPRequestHandler.run(TFTPRequestHandler.java:162)
at com.globalros.tftp.server.TFTPPool$TFTPRHThread.run(TFTPPool.java:278)
Also tried, creating a blank file with this name, and run the upload from CLI. I see same exception in the log.
We are using GlobalRos Tftp server. Is it that the
Java GlobalRos tftp server has problems accessing the mapped Drive?
Could not find any info on its limitations on Google. Any suggestions?