【发布时间】:2013-11-25 16:11:13
【问题描述】:
Path FROM = Paths.get // need to get my file in my bin folder called s.txt, how would this be done?
Path TO = Paths.get("C:\\Temp\\to.txt");
try {
Files.copy(FROM, TO);
} catch (IOException e) {
e.printStackTrace();
}
您好,非常感谢您的帮助,我基本上需要获取位于我的 /bin/path 中的文件的路径
【问题讨论】:
-
你为什么可以得到 to 路径,但不能得到 from?
-
Path FROM = Paths.get("C:\\bin\\s.txt");不起作用吗? -
为什么会这样?我正在尝试从我的项目中获取文件,不确定它在 Java 中的名称,但在大多数其他语言中,它被称为参考。
-
我需要获取bin文件夹中的文件,你知道有bin,src。希望能解决问题。