docs: private File determineMainFile(final String rawName, final String name) {
  
          assert rawName != null;
  
          String mainName = null;
  
          if (name == null) {
              // Just use the default
              mainName = rawName;
          } else if (name.equals(LAST) || name.equals(INITIAL) || name.equals(BOOT)) {
              // Search for a *single* file in the configuration dir with suffix == name.xml
              mainName = findMainFileFromBackupSuffix(historyRoot, name);
          } else if (VERSION_PATTERN.matcher(name).matches()) {
              // Search for a *single* file in the currentHistory dir with suffix == name.xml
              mainName = findMainFileFromBackupSuffix(currentHistory, name);
          }
  
          if (mainName == null) {
              // Search for a *single* file in the snapshots dir with prefix == name.xml
              mainName = findMainFileFromSnapshotPrefix(name);
          }
          if (mainName == null) {
              // Try the basic case, where name is the name
              final File directoryFile = new File(configurationDir, name);
              if (directoryFile.exists()) {
                  mainName = stripPrefixSuffix(name); // TODO what if the stripped name doesn't exist? And why would there be a file like configuration/standalone.last.xml?
              } else if (interactionPolicy.isReadOnly()) {
                  // We allow absolute paths in this case
                  final File absoluteFile = new File(name);
                  if (absoluteFile.exists()) {
                      return absoluteFile;
                  }
              }
          }
          if (mainName == null && !interactionPolicy.isRequireExisting()) {
              mainName = stripPrefixSuffix(name);
          }
          if (mainName != null) {
              return new File(configurationDir, new File(mainName).getName());
          }
  
          throw ControllerLogger.ROOT_LOGGER.mainFileNotFound(name != null ? name : rawName, configurationDir);
      }