MCPcopy Create free account
hub / github.com/davidgiven/luje / canWrite

Method canWrite

lib/java/io/File.java:339–351  ·  view source on GitHub ↗

Indicates whether the current context is allowed to write to this file. @return true if this file can be written, false otherwise. @throws SecurityException if a SecurityManager is installed and it denies the write request.

()

Source from the content-addressed store, hash-verified

337 * write request.
338 */
339 public boolean canWrite() {
340// SecurityManager security = System.getSecurityManager();
341// if (security != null) {
342// security.checkWrite(path);
343// }
344
345 // Cannot use exists() since that does an unwanted read-check.
346 boolean exists = false;
347 if (path.length() > 0) {
348 exists = existsImpl(properPath(true));
349 }
350 return exists && !isReadOnlyImpl(properPath(true));
351 }
352
353 /**
354 * Returns the relative sort ordering of the paths for this file and the

Callers

nothing calls this directly

Calls 4

existsImplMethod · 0.95
properPathMethod · 0.95
isReadOnlyImplMethod · 0.95
lengthMethod · 0.65

Tested by

no test coverage detected