@Nullable public String getText () { return StringHelper.getImploded (m_aContent); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
/** * @return The whole source list as a single string, separated by a blank char. */ @Nonnull public String getAsString () { return StringHelper.getImploded (' ', m_aList); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
/** * @return All addresses as a single string, separated by a "comma char". * Never <code>null</code>. */ @Nonnull public String getAsString () { return StringHelper.getImploded (ADDRESS_SEPARATOR, m_aAddresses); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
@Nullable public String getAsText () { return StringHelper.getImploded (m_aContent); }
@Nullable public String getText () { return StringHelper.getImploded (m_aContent); }
@Nonnull public String getAsString () { if (m_nOpenDivs != 0) s_aLogger.error ("The DIVs are not balanced: " + (m_nOpenDivs > 0 ? m_nOpenDivs + " DIVs are open!" : m_nOpenDivs + " DIVs too many are closed!")); return StringHelper.getImploded (m_aElements); }
@Nonnull public String getAsString () { if (m_nOpenDivs != 0) LOGGER.error ("The DIVs are not balanced: " + (m_nOpenDivs > 0 ? m_nOpenDivs + " DIVs are open!" : m_nOpenDivs + " DIVs too many are closed!")); return StringHelper.getImploded (m_aElements); }
/** * Returns the identifying string for the file name, given a set of tool names * that are used to generate it. */ public static String getIdString (final List <String> toolNames, final String fileName) { final String toolNamePrefix = "Generated by: " + StringHelper.getImploded ('&', toolNames) + ":"; if (toolNamePrefix.length () > 200) { PGPrinter.error ("Tool names too long."); throw new IllegalStateException ("Tool names too long: " + toolNamePrefix); } return toolNamePrefix + " Do not edit this line. " + addUnicodeEscapes (fileName); }
@Nonnull public static ICommonsOrderedMap <String, String> getRequestParameterMap (@Nonnull final HttpServletRequest aHttpRequest) { final ICommonsOrderedMap <String, String> ret = new CommonsLinkedHashMap <> (); for (final Map.Entry <String, String []> aEntry : CollectionHelper.getSortedByKey (aHttpRequest.getParameterMap ()) .entrySet ()) ret.put (aEntry.getKey (), StringHelper.getImploded (", ", aEntry.getValue ())); return ret; }
@Nonnull @Nonempty public String build () { if (!isValid ()) throw new IllegalStateException ("Built Digest auth is not valid!"); final StringBuilder ret = new StringBuilder (HttpDigestAuth.HEADER_VALUE_PREFIX_DIGEST); // Realm is required ret.append (" realm=").append (HttpStringHelper.getQuotedTextString (m_sRealm)); if (m_aDomains.isNotEmpty ()) { ret.append (", domain=") .append (HttpStringHelper.getQuotedTextString (StringHelper.getImploded (' ', m_aDomains))); } // Nonce is required ret.append (", nonce=").append (HttpStringHelper.getQuotedTextString (m_sNonce)); if (m_sOpaque != null) ret.append (", opaque=").append (HttpStringHelper.getQuotedTextString (m_sOpaque)); if (m_eStale.isDefined ()) ret.append (", stale=").append (m_eStale.isTrue () ? "true" : "false"); if (m_sAlgorithm != null) ret.append (", algorithm=").append (m_sAlgorithm); if (m_aQOPs.isNotEmpty ()) ret.append (", qop=").append (HttpStringHelper.getQuotedTextString (StringHelper.getImploded (',', m_aQOPs))); return ret.toString (); } }
@Nonnull public String getAsHTTPHeaderValue () { final ICommonsList <String> aItems = new CommonsArrayList<> (); if (m_aMaxAgeSeconds != null) aItems.add ("max-age=" + m_aMaxAgeSeconds.toString ()); if (m_aSharedMaxAgeSeconds != null) aItems.add ("s-maxage=" + m_aSharedMaxAgeSeconds.toString ()); if (m_bPublic) aItems.add ("public"); if (m_bPrivate) aItems.add ("private"); if (m_bNoCache) aItems.add ("no-cache"); if (m_bNoStore) aItems.add ("no-store"); if (m_bNoTransform) aItems.add ("no-transform"); if (m_bMustRevalidate) aItems.add ("must-revalidate"); if (m_bProxyRevalidate) aItems.add ("proxy-revalidate"); aItems.addAll (m_aExtensions); return StringHelper.getImploded (", ", aItems); }
public void activateGlobally () { // Deactivate other proxy configurations SocksProxyConfig.deactivateGlobally (); UseSystemProxyConfig.deactivateGlobally (); SystemProperties.setPropertyValue (m_eProxyType.getPropertyNameProxyHost (), m_sHost); SystemProperties.setPropertyValue (m_eProxyType.getPropertyNameProxyPort (), Integer.toString (m_nPort)); SystemProperties.setPropertyValue (m_eProxyType.getPropertyNameProxyUserName (), m_sUserName); SystemProperties.setPropertyValue (m_eProxyType.getPropertyNameProxyPassword (), m_sPassword); SystemProperties.setPropertyValue (m_eProxyType.getPropertyNameNoProxyHosts (), StringHelper.getImploded ('|', m_aNonProxyHosts)); }
@Nonnull public IMicroElement getAsMicroElement () { final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, m_bIsAssert ? CSchematronXML.ELEMENT_ASSERT : CSchematronXML.ELEMENT_REPORT); ret.setAttribute (CSchematronXML.ATTR_ID, m_sID); ret.setAttribute (CSchematronXML.ATTR_FLAG, m_sFlag); ret.setAttribute (CSchematronXML.ATTR_TEST, m_sTest); if (CollectionHelper.isNotEmpty (m_aDiagnostics)) ret.setAttribute (CSchematronXML.ATTR_DIAGNOSTICS, StringHelper.getImploded (' ', m_aDiagnostics)); if (m_aRich != null) m_aRich.fillMicroElement (ret); if (m_aLinkable != null) m_aLinkable.fillMicroElement (ret); if (m_aForeignElements != null) for (final IMicroElement aForeignElement : m_aForeignElements) ret.appendChild (aForeignElement.getClone ()); for (final Object aContent : m_aContent) if (aContent instanceof String) ret.appendText ((String) aContent); else ret.appendChild (((IPSElement) aContent).getAsMicroElement ()); if (m_aForeignAttrs != null) for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ()) ret.setAttribute (aEntry.getKey (), aEntry.getValue ()); return ret; }
@Nonnull public IMicroElement getAsMicroElement () { final IMicroElement ret = new MicroElement (CSchematron.NAMESPACE_SCHEMATRON, m_bIsAssert ? CSchematronXML.ELEMENT_ASSERT : CSchematronXML.ELEMENT_REPORT); ret.setAttribute (CSchematronXML.ATTR_ID, m_sID); ret.setAttribute (CSchematronXML.ATTR_FLAG, m_sFlag); ret.setAttribute (CSchematronXML.ATTR_TEST, m_sTest); if (CollectionHelper.isNotEmpty (m_aDiagnostics)) ret.setAttribute (CSchematronXML.ATTR_DIAGNOSTICS, StringHelper.getImploded (' ', m_aDiagnostics)); if (m_aRich != null) m_aRich.fillMicroElement (ret); if (m_aLinkable != null) m_aLinkable.fillMicroElement (ret); if (m_aForeignElements != null) for (final IMicroElement aForeignElement : m_aForeignElements) ret.appendChild (aForeignElement.getClone ()); for (final Object aContent : m_aContent) if (aContent instanceof String) ret.appendText ((String) aContent); else ret.appendChild (((IPSElement) aContent).getAsMicroElement ()); if (m_aForeignAttrs != null) for (final Map.Entry <String, String> aEntry : m_aForeignAttrs.entrySet ()) ret.setAttribute (aEntry.getKey (), aEntry.getValue ()); return ret; }
@Nonnull public IMicroElement getAsMicroNode () { final IMicroElement eRet = new MicroElement ("threadlist"); if (StringHelper.hasText (m_sError)) eRet.appendElement ("error").appendText (m_sError); // Overall thread count eRet.setAttribute ("threadcount", m_aList.size ()); // Emit thread IDs grouped by state final ICommonsMap <State, ICommonsNavigableSet <Long>> aStateMap = _getStateMap (); for (final State eState : State.values ()) { final ICommonsSet <Long> aThreadIDs = aStateMap.get (eState); final int nSize = aThreadIDs.size (); final IMicroElement eThreadState = eRet.appendElement ("threadstate"); eThreadState.setAttribute ("id", eState.toString ()); eThreadState.setAttribute ("threadcount", nSize); if (nSize > 0) eThreadState.appendText (StringHelper.getImploded (',', aThreadIDs)); } // Append all stack traces at the end for (final ThreadDescriptor aDescriptor : m_aList) eRet.appendChild (aDescriptor.getAsMicroNode ()); return eRet; }