isDirectoryExists method creates directory instead of just checking up
artemtrofimov opened this issue · comments
What you should do to reproduce the bug
Storage storage = SimpleStorage.getInternalStorage(context); Log.e("1", "does " + DIR_PATH + " exist " + storage.isDirectoryExists(DIR_PATH);
Always returns true
, because this method actually creates the dir.
Why does this happen?
AbstractDiskStorage invokes buildPath(name)
inside isDirectoryExists(String name)
.
buildPath(name)
has context.getDir(directoryName, Context.MODE_PRIVATE)
in InternalStorage implementation.
getDir
method creates the dir if it does not already exist.
You are totally right and it's a bug. Fixed in latest version.