Converts a string to a CmsHistoryVersion.<p>

This is the inverse of toString().

@param s the string from which to read the history version

@return the history version
547214
public static CmsHistoryVersion fromString(String s) {

        List<String> l = CmsStringUtil.splitAsList(s, ":");
        if (l.size() == 2) {

            Integer ver = null;
            try {
                ver = Integer.valueOf(l.get(0));
            } catch (Exception e) {
                //
            }
            OfflineOnline onlineStatus = "null".equals("" + l.get(1)) ? null : OfflineOnline.valueOf(l.get(1));
            return new CmsHistoryVersion(ver, onlineStatus);
        }
        return null;

    }
892671
public static AsteriskVersion getDetermineVersionFromString(String coreLine)
    {
        for (AsteriskVersion version : knownVersions)
        {
            for (Pattern pattern : version.patterns)
            {
                if (pattern.matcher(coreLine).matches())
                {
                    return version;
                }
            }
        }

        return null;
    }
899686
protected String getVersion(String version) {
        return this.version == null || this.version.length() == 0
                ? version
                : this.version;
    }
966647
public void setVersion(String version) {

        m_number = 0L;
        if ((version == null) || (version.charAt(0) == '.') || (version.charAt(version.length() - 1) == '.')) {
            throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NOT_NUMBER_0));
        }
        String[] split = CmsStringUtil.splitAsArray(version, '.');
        m_dots = split.length;
        if (m_dots > 4) {
            throw new CmsIllegalArgumentException(
                Messages.get().container(Messages.ERR_INVALID_VERSION_LENGTH_1, version));
        }
        String[] numbers = new String[5];
        System.arraycopy(split, 0, numbers, 1, m_dots);
        numbers[0] = "1";
        for (int i = 1 + m_dots; i < 5; i++) {
            numbers[i] = "0";
        }
        for (int i = numbers.length - 1; i >= 0; i--) {
            try {
                int number = Integer.valueOf(numbers[numbers.length - i - 1]).intValue();

                if ((number > 999) || (number < 0)) {
                    throw new CmsIllegalArgumentException(
                        Messages.get().container(Messages.ERR_INVALID_VERSION_SUBNUMBER_1, new Integer(number)));
                }
                m_number = ((long)Math.pow(1000.0, i) * number) + m_number;
            } catch (NumberFormatException e) {
                // no valid version provided
                throw new CmsIllegalArgumentException(Messages.get().container(Messages.ERR_NOT_NUMBER_0));
            }
        }

        setVersion(m_number);
    }
732347
public static String getJavaVersion() {
        String[] sysPropParms = new String[] {"java.runtime.version", "java.version"};
        for (int i = 0; i < sysPropParms.length; i++) {
            String val = System.getProperty(sysPropParms[i]);
            if (!StringUtil.isEmpty(val)) {
                return val;
            }
        }
        return null;
    }
394160
public String getVersion() {
        final Object version = getHeader(HttpMessageHeaders.HTTP_VERSION);

        if (version != null) {
            return version.toString();
        }

        return null;
    }
913249
@SuppressWarnings("unchecked")
  public <T extends CMAResource> T setVersion(Integer version) {
    getSystem().setVersion(version);
    return (T) this;
  }
702083
public List<I_CmsHistoryResource> readAllAvailableVersions(CmsResource resource) throws CmsException {

        return m_securityManager.readAllAvailableVersions(m_context, resource);
    }
406726
public Version parseVersion(final String version) {
    checkNotNull(version);
    try {
      return versionScheme.parseVersion(version);
    }
    catch (InvalidVersionSpecificationException e) {
      throw Throwables.propagate(e);
    }
  }
231529
public CmsHistoryProject readHistoryProject(CmsRequestContext context, CmsUUID projectId) throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        CmsHistoryProject result = null;
        try {
            result = m_driverManager.readHistoryProject(dbc, projectId);
        } catch (Exception e) {
            dbc.report(
                null,
                Messages.get().container(
                    Messages.ERR_READ_HISTORY_PROJECT_2,
                    projectId,
                    dbc.currentProject().getName()),
                e);
        } finally {
            dbc.clear();
        }
        return result;
    }
1143213
public static String decodeString(String s) {

        try {
            return new String(CODEC.decode(s), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            // shouldn't happen
            return null;
        }
    }
1028102
public static String toUpperCaseFirstOne(String s) {
		if (Character.isUpperCase(s.charAt(0)))
			return s;
		else
			return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
	}
1374338
public static String convert32(String s)
    {
        try {
            byte[] bytes = s.getBytes();
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(bytes);
            bytes = md.digest();
            int j = bytes.length;
            char[] chars = new char[j * 2];
            int k = 0;
            for (int i = 0; i < bytes.length; i++) {
                byte b = bytes[i];
                chars[k++] = hexChars[b >>> 4 & 0xf];
                chars[k++] = hexChars[b & 0xf];
            }
            return new String(chars);
        }
        catch (Exception e){
            return null;
        }
    }
1291619
@Nullable
    public static Age fromPanasonicString(@NotNull String s)
    {
        if (s.length() != 19 || s.startsWith("9999:99:99"))
            return null;

        try {
            int years = Integer.parseInt(s.substring(0, 4));
            int months = Integer.parseInt(s.substring(5, 7));
            int days = Integer.parseInt(s.substring(8, 10));
            int hours = Integer.parseInt(s.substring(11, 13));
            int minutes = Integer.parseInt(s.substring(14, 16));
            int seconds = Integer.parseInt(s.substring(17, 19));

            return new Age(years, months, days, hours, minutes, seconds);
        }
        catch (NumberFormatException ignored)
        {
            return null;
        }
    }
386417
public String getPublishedByName(CmsObject cms) {

        try {
            return CmsPrincipal.readPrincipalIncludingHistory(cms, getPublishedBy()).getName();
        } catch (CmsException e) {
            return getPublishedBy().toString();
        }
    }
129419
public static ImmutableList<String> toCodepointStrings(final String s) {
    final ImmutableList.Builder<String> ret = ImmutableList.builder();
    for (int codePoint : toCodepoints(s)) {
      ret.add(new String(Character.toChars(codePoint)));
    }
    return ret.build();
  }
261553
private String extractNumericVersion(Collection<String> versionStrings) {
        if (versionStrings == null) {
            return "";
        }
        for (String value : versionStrings) {
            String releaseValue = calculateReleaseVersion(value);
            if (!releaseValue.equals(value)) {
                return releaseValue;
            }
        }
        return "";
    }