boolean java.io.File.mkdir()和boolean java.io.File.exists()解释
2014-08-15 10:01
337 查看
public boolean mkdir ()
Since: API Level 1
Creates the directory named by the trailing filename of this file. Does not create the complete path required to create this directory.
创建一个目录根据指定的文件名。
Note that this method does not throw IOException on failure. Callers must check the return value.
Returns
true if the directory has been created, false otherwise.
See Also
mkdirs()
例如:
File dir = new File(SDPATH + dirName);
dir.mkdir();
2、boolean java.io.File.exists()
public boolean exists ()
Since: API Level 1
Returns a boolean indicating whether this file can be found on the underlying file system.
Returns
true if this file exists, false otherwise.
判断文件是否存在。
相关文章推荐
- boolean java.io.File.mkdir()和boolean java.io.File.exists()解释
- java.io.File.setExecutable(boolean executable) 方法来设置所有者对于此抽象路径名执行权限。
- 一个字母引发的血案 java.io.File中mkdir()和mkdirs()
- java 中的renameTO/java.io.File中mkdir和mkdirs的区别
- java.io.file 中mkdir和mkdirs的区别
- java.io.File中mkdir()和mkdirs()的区别
- 一个字母引发的血案 java.io.File中mkdir()和mkdirs()
- java.io.File.setWritable(boolean writable, boolean ownerOnly)
- java.io.File中mkdir()和mkdirs()的区别
- 一个字母引发的血案 java.io.File中mkdir()和mkdirs()_0
- java.io.File mkdir() 和 mkdirs()的差别
- 一个字母引发的血案 java.io.File中mkdir()和mkdirs
- java.io.file.isfile与exists区别
- java.io.File中mkdir()和mkdirs()的区别
- java.io.RandomAccessFile
- java.io.file.delete()不能正常删除文件的原因!
- java file io
- [原]在Oracle SOASUITE 10g 调用ESB 报“java.io.FileNotFoundException: /u01/esb/product/10.1.3.1/j2ee/home/../Context.properties”问题的解决办法
- [原]在Oracle SOASUITE 10g Register ESB 报“java.io.IOException: Service TxContentFileStore”问题的解决办法
- java.io.FileNotFoundException: /tmp/upload_234sad_