code: private CmsWebdavRange parseContentRange(HttpServletRequest request, HttpServletResponse response) {
  
          // Retrieving the content-range header (if any is specified
          String rangeHeader = request.getHeader(HEADER_CONTENTRANGE);
  
          if (rangeHeader == null) {
              return null;
          }
  
          // bytes is the only range unit supported
          if (!rangeHeader.startsWith("bytes")) {
              response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              return null;
          }
  
          rangeHeader = rangeHeader.substring(6).trim();
  
          int dashPos = rangeHeader.indexOf('-');
          int slashPos = rangeHeader.indexOf('/');
  
          if (dashPos == -1) {
              response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              return null;
          }
  
          if (slashPos == -1) {
              response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              return null;
          }
  
          CmsWebdavRange range = new CmsWebdavRange();
  
          try {
              range.setStart(Long.parseLong(rangeHeader.substring(0, dashPos)));
              range.setEnd(Long.parseLong(rangeHeader.substring(dashPos + 1, slashPos)));
              range.setLength(Long.parseLong(rangeHeader.substring(slashPos + 1, rangeHeader.length())));
          } catch (NumberFormatException e) {
              response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              return null;
          }
  
          if (!range.validate()) {
              response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
              return null;
          }
  
          return range;
      }
docs: Parse the content-range header.<p>
  
  @param request the servlet request we are processing
  @param response the servlet response we are creating
  
  @return the range of the content read from the header