/** * Check if the passed filename is a CSS filename (independent if regular or * minified) * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a CSS filename. */ public static boolean isCSSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_CSS); }
public static boolean isMinifiedJSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CJS.FILE_EXTENSION_MIN_JS); }
/** * Check if the passed filename is a minified CSS filename * * @param sFilename * The filename to check. * @return <code>true</code> if the passed filename is a minified CSS * filename. */ public static boolean isMinifiedCSSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CCSS.FILE_EXTENSION_MIN_CSS); }
public static boolean isJSFilename (@Nullable final String sFilename) { return StringHelper.endsWith (sFilename, CJS.FILE_EXTENSION_JS); }
@Nonnull public static String getTextWithState (@Nonnull final String sText, @Nonnull final ELabelType eType) { ValueEnforcer.notNull (sText, "Text"); ValueEnforcer.notNull (eType, "Type"); // Trim optional trailing colon String sPlainText = StringHelper.trimEnd (sText.trim (), LABEL_END); // Append suffix only, if at least some text is present if (StringHelper.hasText (sPlainText)) sPlainText += getSuffix (eType, !StringHelper.endsWith (sPlainText, '?')); return sPlainText; }
@Nonnull public PhotonGlobalStatePerApp setServletPath (@Nonnull @Nonempty final String sServletPath) { ValueEnforcer.notEmpty (sServletPath, "ApplicationServletPath"); ValueEnforcer.isTrue (StringHelper.startsWith (sServletPath, '/'), "ApplicationServletPath must start with a slash"); ValueEnforcer.isFalse (StringHelper.endsWith (sServletPath, '/'), "ApplicationServletPath must end with a slash"); m_aRWLock.writeLocked ( () -> m_sServletPath = sServletPath); return this; }
if (StringHelper.hasText (sSMLZoneName) && !StringHelper.endsWith (sSMLZoneName, '.')) throw new PeppolDNSResolutionException ("if an SML zone name is specified, it must end with a dot (.). Value is: " + sSMLZoneName);
if (StringHelper.startsWith (sOrigValue, '[') && StringHelper.endsWith (sOrigValue, ']'))
@Nonnull public static <T extends IHCNodeWithChildren <?>> T getNodeWithState (@Nonnull final T aNode, @Nonnull final ELabelType eType) { ValueEnforcer.notNull (aNode, "Node"); ValueEnforcer.notNull (eType, "Type"); // Only append the suffix, if at least one text child is present if (HCUtils.recursiveContainsAtLeastOneTextNode (aNode)) { final String sPlainText = aNode.getPlainText (); if (sPlainText.length () > 0) { final String sSuffixString = getSuffixString (eType); if (StringHelper.hasText (sSuffixString) && StringHelper.endsWith (sPlainText, sSuffixString)) { // Append only colon aNode.addChild (LABEL_END); } else if (!StringHelper.endsWith (sPlainText, LABEL_END)) aNode.addChild (getSuffix (eType, true)); } } return aNode; } }
if (StringHelper.endsWith (sRelativeFilename, "/") || StringHelper.hasNoText (sFilename))
if (StringHelper.hasText (sSMLZoneName) && !StringHelper.endsWith (sSMLZoneName, '.')) throw new PeppolDNSResolutionException ("if an SML zone name is specified, it must end with a dot (.). Value is: " + sSMLZoneName);