Creates a new, empty file on the file system according to the path information stored in this file. @return true if the file has been created, false if it already exists. @throws IOException if an I/O error occurs or the directory does not exist where
()
| 1220 | * access for this file. |
| 1221 | */ |
| 1222 | public boolean createNewFile() throws IOException { |
| 1223 | // SecurityManager security = System.getSecurityManager(); |
| 1224 | // if (security != null) { |
| 1225 | // security.checkWrite(path); |
| 1226 | // } |
| 1227 | if (0 == path.length()) { |
| 1228 | throw new IOException(Messages.getString("luni.B3")); //$NON-NLS-1$ |
| 1229 | } |
| 1230 | int result = newFileImpl(properPath(true)); |
| 1231 | switch (result) { |
| 1232 | case 0: |
| 1233 | return true; |
| 1234 | case 1: |
| 1235 | return false; |
| 1236 | default: |
| 1237 | throw new IOException(Messages.getString("luni.B4", path)); //$NON-NLS-1$ |
| 1238 | } |
| 1239 | } |
| 1240 | |
| 1241 | private native int newFileImpl(byte[] filePath); |
| 1242 |
no test coverage detected