Is there a specific String I can use to create a file such that
file.exists() will always return false?
Basically, I'm trying to avoid having to check for null all the time.
So, when I create a new project, I want to set it's starting save path
(AKA it hasn't been saved yet) to something where file.exists() =
false. String path = new String("") *seems* to work, but I wanted to
make sure.
Thanks
External Concepts Guild - 05 Jan 2008 14:37 GMT
> Is there a specific String I can use to create a file such that
> file.exists() will always return false?
[quoted text clipped - 6 lines]
>
> Thanks
Probably not. If there were, it would be OS specific.
Maybe you could use
File.createTempFile(String prefix,String suffix).
Emory Merryman
External Concepts Guild
Mike Schilling - 05 Jan 2008 20:25 GMT
> Is there a specific String I can use to create a file such that
> file.exists() will always return false?
[quoted text clipped - 7 lines]
> to
> make sure.
File isn't a final class. Create a subclass in which File.exists()
returns false.