code: private void verifyReplication(String src,
                                   short replication,
                                   String clientName
    ) throws IOException {
      String text = "file " + src
        + ((clientName != null) ? " on client " + clientName : "")
        + ".\n"
        + "Requested replication " + replication;
  
      if (replication > maxReplication) {
        throw new IOException(text + " exceeds maximum " + maxReplication);
      }
  
      if (replication < minReplication) {
        throw new IOException(
          text + " is less than the required minimum " + minReplication);
      }
    }
docs: Check whether the replication parameter is within the range
  determined by system configuration.