Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有段代码有些疑问 #3

Open
GoogleCodeExporter opened this issue Apr 1, 2015 · 2 comments
Open

有段代码有些疑问 #3

GoogleCodeExporter opened this issue Apr 1, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

--------------------------------------------------------------------
public FSQueue(String dir, int fileLimitLength) throws Exception {
        this.fileLimitLength = fileLimitLength;
        File fileDir = new File(dir);
        if (fileDir.exists() == false && fileDir.isDirectory() == false) {
            if (fileDir.mkdirs() == false) {
                throw new IOException("create dir error");
            }
        }
---------------------------------------------------------------------

问题:如果dir是一个已经存在的文件路径,如“E:/a/b.txt”;�
��么就会有问题!抛出
“java.io.IOException: 系统找不到指定的路径。”

Original issue reported on code.google.com by kehan201...@gmail.com on 1 Dec 2011 at 5:10

@GoogleCodeExporter
Copy link
Author

肯定会抛出异常,要直接使用,得自己保证路径的正确性。

Original comment by sunli1...@gmail.com on 1 Dec 2011 at 8:18

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

嗯好。

Original comment by kehan201...@gmail.com on 1 Dec 2011 at 9:55

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant