docs: public static ServerLock createServerLock(BootstrapConfig bootProps) {
          String serverName = bootProps.getProcessName();
          File serverDir = bootProps.getConfigFile(null);
          File serverOutputDir = bootProps.getOutputFile(null);
          File serverWorkArea = bootProps.getWorkareaFile(null);
  
          ServerLock serverLock = new ServerLock(serverName, serverWorkArea);
  
          // Don't create serverDir if it doesn't exist
          // (--create will be required to create new server)
  
          Boolean fileExists = null;
          final File sDir = serverDir;
          try {
              fileExists = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!sDir.exists()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
          if (fileExists != null && !(fileExists.booleanValue())) {
              return serverLock;
          }
  
          boolean writable = true;
  
          final File soDir = serverOutputDir;
          try {
              fileExists = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!soDir.exists()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          if (fileExists != null && !(fileExists.booleanValue())) {
              // if (!serverOutputDir.exists())
              writable = serverWorkArea.mkdirs();
          }
  
          Boolean canWrite = null;
          try {
              canWrite = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!soDir.canWrite()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          if (!writable || ((canWrite != null) && !(canWrite.booleanValue()))) {
              //if (!writable || !serverOutputDir.canWrite()) {
              throw new LaunchException("Write permission required for server output directory, check directory permissions", MessageFormat.format(BootstrapConstants.messages.getString("error.serverDirPermission"),
                                                                                                                                                   serverOutputDir.getAbsolutePath()));
          }
  
          final File swArea = serverWorkArea;
          try {
              fileExists = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!swArea.exists()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          if (fileExists != null && !fileExists.booleanValue())
              //if (!serverWorkArea.exists())
              writable = serverWorkArea.mkdirs();
  
          try {
              canWrite = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!swArea.canWrite()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          if (!writable || (canWrite != null && !canWrite.booleanValue())) {
              //if (!writable || !serverWorkArea.canWrite()) {
              throw new LaunchException("Can not create server workarea, check directory permissions", MessageFormat.format(BootstrapConstants.messages.getString("error.serverDirPermission"),
                                                                                                                            serverWorkArea.getAbsolutePath()));
          }
  
          writable = true;
  
          final File slf = serverLock.lockFile;
          try {
              fileExists = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!slf.exists()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          //if (!serverLock.lockFile.exists()) {
  
          if (fileExists != null && !fileExists.booleanValue()) {
  
              try {
                  writable = serverLock.lockFile.createNewFile();
              } catch (IOException e) {
                  writable = false;
              }
          }
  
          try {
              canWrite = AccessController.doPrivileged(new java.security.PrivilegedExceptionAction<Boolean>() {
                  @Override
                  public Boolean run() throws Exception {
                      if (!slf.canWrite()) {
                          return Boolean.FALSE;
                      }
                      return Boolean.TRUE;
                  }
              });
          } catch (Exception ex) {
          }
  
          if (!writable || !canWrite) {
              throw new LaunchException("Can not create or write to lock file, check file permissions", MessageFormat.format(BootstrapConstants.messages.getString("error.serverDirPermission"),
                                                                                                                             serverLock.lockFile.getAbsolutePath()));
          }
          return serverLock;
      }