private boolean resolveDirectoryConflictTrivially(Path canonicalPath, Path conflictingPath) throws IOException {
		if (!Files.exists(canonicalPath)) {
			Files.move(conflictingPath, canonicalPath, StandardCopyOption.ATOMIC_MOVE);
			return true;
		} else if (hasSameDirFileContent(conflictingPath, canonicalPath)) {
			// there must not be two directories pointing to the same dirId.
			LOG.info("Removing conflicting directory file {} (identical to {})", conflictingPath, canonicalPath);
			Files.deleteIfExists(conflictingPath);
			return true;
		} else {
			return false;
		}
	}
private boolean resolveDirectoryConflictTrivially ( Path canonicalPath , Path conflictingPath ) throws IOException { if ( ! Files . exists ( canonicalPath ) ) { Files . move ( conflictingPath , canonicalPath , StandardCopyOption . ATOMIC_MOVE ) ; return true ; } else if ( hasSameDirFileContent ( conflictingPath , canonicalPath ) ) { LOG . info ( "Removing conflicting directory file {} (identical to {})" , conflictingPath , canonicalPath ) ; Files . deleteIfExists ( conflictingPath ) ; return true ; } else { return false ; } }
Tries to resolve a conflicting directory file without renaming the file. If successful, only the file with the canonical path will exist afterwards.

@param canonicalPath The path to the original (conflict-free) directory file (must not exist).
@param conflictingPath The path to the potentially conflicting file (known to exist).
@return <code>true</code> if the conflict has been resolved.
@throws IOException