java中 file 的名字为什么不能有中括号 ???

在,,,,,,,,eclipse中,,工程的名字不能有中括号。。。。。。。。



    private File getFile(String filename) throws IOException {
        URL url = ConfigurationFileManager.class.getClassLoader().getResource(filename);
        if (url != null) {
            return new File(url.getFile());
        }
        File file = new File(filename);
        if (file.exists()) {
            return file;
        }
        throw new IOException("can not locate " + filename);
    }



一个文件的URL 为空时。。。。这个文件 还可能存在吗  ????
不知道 。。。


当一个文件URL 不为空时。。。这个文件是可以不存在的。。。。。。。。。
比如,,文件的路径有不认识的字符(中括号情况)。

你可能感兴趣的:(java,eclipse)