[英]Creating File in other pc Connected to Lan using java
I am trying to Create a txt file using java in other pc and i am trying to doing code is. 我正在尝试在其他PC中使用Java创建txt文件,而我正在尝试执行代码。
try {
File f = new File("sftp://ip/home/username/krish.txt");
boolean check = f.createNewFile();
if (check) {
System.out.println("File Created!!!");
return true;
}
else{
System.out.println("File not Created!!!");
return false;
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
what i am getting error is : 我得到的错误是:
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:959)
can any body suggest solution? 有人可以建议解决方案吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.