Returns the longest rfs prefix matching a given already translated rfs name.<p>

@param rfsName the rfs name

@return its rfs prefix

@see #getRfsPrefix(String)
483109
protected String getRfsPrefixForRfsName(String rfsName) {

        String retVal = "";
        // default case
        if (rfsName.startsWith(m_rfsPrefix + "/")) {
            retVal = m_rfsPrefix;
        }
        // additional rules
        Iterator<CmsStaticExportRfsRule> it = m_rfsRules.iterator();
        while (it.hasNext()) {
            CmsStaticExportRfsRule rule = it.next();
            String rfsPrefix = rule.getRfsPrefix();
            if (rfsName.startsWith(rfsPrefix + "/") && (retVal.length() < rfsPrefix.length())) {
                retVal = rfsPrefix;
            }
        }
        return retVal;
    }
904087
public static String getFileSuffix(String fileName) {
        return fileName.substring(fileName.lastIndexOf(ValueConsts.DOT_SIGN) + 1);
    }
23792
public boolean isSuffixExportable(String resourceName) {

        if (resourceName == null) {
            return false;
        }
        int pos = resourceName.lastIndexOf('.');
        if (pos >= 0) {
            String suffix = resourceName.substring(pos).toLowerCase();
            return m_exportSuffixes.contains(suffix);
        }
        return false;
    }
486143
public String getSuffix() {

        if (m_suffix == null) {
            StringBuffer result = new StringBuffer();
            if (m_query != null) {
                result.append('?');
                result.append(m_query);
            }
            if (m_anchor != null) {
                result.append('#');
                result.append(m_anchor);
            }
            m_suffix = result.toString();
        }
        return m_suffix;
    }
1159003
public boolean hasCacheContent(String rfsName) {

        File f = new File(rfsName);
        if (f.exists()) {
            return true;
        }
        return false;
    }
1278059
private String getLongPrefix(String token)
    {
        String t = Util.stripLeadingHyphens(token);

        int i;
        String opt = null;
        for (i = t.length() - 2; i > 1; i--)
        {
            String prefix = t.substring(0, i);
            if (options.hasLongOption(prefix))
            {
                opt = prefix;
                break;
            }
        }
        
        return opt;
    }
370665
public static String getResourceName(String keyName) {

        if (keyName.endsWith(CmsFlexCache.CACHE_OFFLINESUFFIX) | keyName.endsWith(CmsFlexCache.CACHE_ONLINESUFFIX)) {
            return keyName.split(" ")[0];
        } else {
            return "";
        }
    }
1014038
function getResourcePath(sResourceName, sSuffix) {

		var sNamePrefix = sResourceName,
			p = sResourceName.length,
			sPath;

		// search for a registered name prefix, starting with the full name and successively removing one segment
		while ( p > 0 && !mUrlPrefixes[sNamePrefix] ) {
			p = sNamePrefix.lastIndexOf('/');
			// Note: an empty segment at p = 0 (leading slash) will be ignored
			sNamePrefix = p > 0 ? sNamePrefix.slice(0, p) : '';
		}

		assert((p > 0 || sNamePrefix === '') && mUrlPrefixes[sNamePrefix], "there always must be a mapping");

		sPath = mUrlPrefixes[sNamePrefix].url + sResourceName.slice(p + 1); // also skips a leading slash!

		//remove trailing slash
		if ( sPath.slice(-1) === '/' ) {
			sPath = sPath.slice(0, -1);
		}
		return sPath + (sSuffix || '');

	}
1104346
public Opt<String> getAutoCompleteSuffix() {
        if (possibilities.isEmpty()) {
            // There are no auto-complete possibilities.
            return Opt.absent();
        }

        if (possibilities.size() > 1) {
            // Multiple auto complete results are possible.
            // AutoComplete as much as is possible - until the longest common prefix.
            final String longestPrefix = possibilities.getLongestPrefix();
            return StringUtils.getNonEmptyString(calcAutoCompleteSuffix(longestPrefix));
        }

        // TODO: Only 1 possibility, boundParams should be updated to show it...
        // Only a single auto complete result is possible, append it to the command line.
        // Let's be helpful - depending on the autoCompleteType,
        // add the suffix that each valueType must have.
        final Entry<String, CliValueType> entry = possibilities.entrySet().iterator().next();
        final String singlePossibility = entry.getKey();
        final CliValueType type = entry.getValue();
        final String suffix = calcAutoCompleteSuffix(singlePossibility);
        return Opt.of(suffix + type.getSuffix());
    }
1114758
@Override
	public String getPrefixedKey(final String prefixString, final String key) {
		lock.readLock().lock();
		try {
			if (prefixString != null && prefixes.contains(prefixString) && key != null) {
				return new StringBuilder(prefixString).append(getPrefixDelimiter()).append(key).toString();
			}
		} finally {
			lock.readLock().unlock();
		}
		throw new IllegalArgumentException("The given prefix is not part of this PrefixConfig or the key is null.");
	}
1138293
@VisibleForTesting
	static String createIncompletePartObjectNamePrefix(String objectName) {
		checkNotNull(objectName);

		final int lastSlash = objectName.lastIndexOf('/');
		final String parent;
		final String child;

		if (lastSlash == -1) {
			parent = "";
			child = objectName;
		} else {
			parent = objectName.substring(0, lastSlash + 1);
			child = objectName.substring(lastSlash + 1);
		}
		return parent + (child.isEmpty() ? "" : '_') + child + "_tmp_";
	}
1248455
protected String lookupNamespaceURIImpl(String name) {
        String prefix = getPrefixFromQualifiedName(name);
        String namespaceURI = this.xmlNode.lookupNamespaceURI(prefix);
        return namespaceURI;
    }
653120
public static String createEndSuffixFileName(String fileName, String endSuffix) {
        int    index       = fileName.lastIndexOf(".");
        String preFileName = fileName.substring(0, index);
        String suffix      = fileName.substring(index);
        return preFileName + endSuffix + suffix;
    }
596824
@TCB
  private static int longestPrefixOfGoodCodeunits(String s) {
    int n = s.length(), i;
    for (i = 0; i < n; ++i) {
      char ch = s.charAt(i);
      if (ch < 0x20) {
        if (IS_BANNED_ASCII[ch]) {
          return i;
        }
      } else if (0xd800 <= ch) {
        if (ch <= 0xdfff) {
          if (i+1 < n && Character.isSurrogatePair(ch, s.charAt(i+1))) {
            ++i;  // Skip over low surrogate since we know it's ok.
          } else {
            return i;
          }
        } else if ((ch & 0xfffe) == 0xfffe) {
          return i;
        }
      }
    }
    return -1;
  }
802714
public final String getExplicitPrefix(String uri)
    {
        if (mNsMapping != null) {
            String prefix = mNsMapping.findPrefixByUri(uri);
            if (prefix != null) {
                return prefix;
            }
        }
        if (mRootNsContext != null) {
            String prefix = mRootNsContext.getPrefix(uri);
            if (prefix != null) {
                // Hmmh... still can't use the default NS:
                if (prefix.length() > 0) {
                    return prefix;
                }
                // ... should we try to find an explicit one?
            }
        }
        return null;
    }
824657
@Override
    public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
        if ((defaultNamespace!=null) && (namespaceUri.equals(defaultNamespace))) {
            return "";
        }

        if (namespaceUri.equals(PROV_NS)) {
            return "prov";
        }
        if (namespaceUri.equals(PRINTER_NS)) {
            return "prn";
        }
   //     if (namespaceUri.equals(XSD_NS)) {
   //         return "xsd";
   //     }
        if (namespaceUri.equals(DOMProcessing.XSD_NS_FOR_XML)) { // TODO: TO CHECK that's the one we need
            return "xsd";
        }
        if (namespaceUri.equals(XML_NS)) {
            return "xml";
        }
        if (namespaceUri.equals(XSI_NS)) {
            return "xsi";
        }
        for (String k: nss.keySet()) {
            if (nss.get(k).equals(namespaceUri)) {
                return k;
            }
        }
        return suggestion;
    }
1352366
public static String getNameForClassloaderResource(String resourceName) {
        String fileName = resourceName;
        if (resourceName.indexOf('/') != -1) {
            fileName = resourceName.substring(resourceName.lastIndexOf('/') + 1, resourceName.length());
        }
        return fileName;
    }