/* (non-Javadoc)
@see com.ibm.jaggr.service.impl.transport.AbstractHttpTransport#isServerExpandable(javax.servlet.http.HttpServletRequest, java.lang.String)
775143
@Override
	public boolean isServerExpandable(HttpServletRequest request, String mid) {
		int idx = mid.indexOf("!"); //$NON-NLS-1$
		String plugin = idx != -1 ? mid.substring(0, idx) : null;
		String name = idx != -1 ? mid.substring(idx+1) : mid;
		if (name.startsWith("/") || urlId.matcher(name).find() || name.contains("?")) { //$NON-NLS-1$ //$NON-NLS-2$
			return false;
		}
		if (plugin != null) {
			IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME);
			if (!aggr.getConfig().getTextPluginDelegators().contains(plugin) &&
					!aggr.getConfig().getJsPluginDelegators().contains(plugin)) {
				return false;
			}
		}
		return true;
	}
279163
public boolean isCancelled() {
        if (svLogger.isLoggable(Level.FINER))
            svLogger.logp(Level.FINER, CLASS_NAME, "isCancelled", toString());
        return (ivCancellationException != null); // d614969
    }
632215
protected boolean isExpanded(Map<String,String> parameters)
    {
        String all = parameters.get("expanded");
        return all != null && Boolean.valueOf(all);
    }
463007
@Override
    protected boolean isCompressionAllowed() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "isCompressionAllowed");
        }
        // check on whether we've already done this step
        if (this.bCheckedAcceptEncoding) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "isCompressionAllowed(1): " + this.bCompressionAllowed);
            }
            return this.bCompressionAllowed;
        }

        boolean rc = false;

        // check target compression first
        byte[] name = null;
        if (isGZipEncoded() || isXGZipEncoded()) {
            // gzip and x-gzip are functionally the same
            name = ContentEncodingValues.GZIP.getByteArray();
        } else if (isZlibEncoded()) {
            name = ContentEncodingValues.DEFLATE.getByteArray();
        } else {
            this.bCheckedAcceptEncoding = true;
            this.bCompressionAllowed = false;
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
                Tr.exit(tc, "isCompressionAllowed(2)", Boolean.FALSE);
            }
            return false;
        }

        // comma separated values, < encoding[;q=x] > or < *[;q=x] >

        // loop through looking for the matching encoding, then check the qvalue
        // for 0 (not allowed). Keep track if * was found for a final check
        // if the explicit encoding wasn't found.
        int index = 0;
        int x;
        boolean bStarFound = false;
        boolean bStarApproved = false;
        byte[] data = getRequest().getHeader(HttpHeaderKeys.HDR_ACCEPT_ENCODING).asBytes();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "isCompressionAllowed: parsing ["
                         + getRequest().getHeader(HttpHeaderKeys.HDR_ACCEPT_ENCODING).asString()
                         + "] against requested [" + new String(name) + "]");
        }

        if (null != data) {
            while (index < data.length) {
                // search each encoding token (skip leading white space)
                index = skipWhiteSpace(data, index);
                if (index >= data.length) {
                    // if the header value was just empty space then only
                    // the identity encoding is acceptable
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Ran out of data");
                    }
                    break;
                }
                // check for the asteric explicitly
                if ('*' == data[index]) {
                    bStarFound = true;
                    if (++index < data.length && BNFHeaders.SEMICOLON == data[index]) {
                        // now check for the qvalue and set the approved flag
                        ReturnCodes myRC = parseQValue(data, ++index);
                        bStarApproved = myRC.getBooleanValue();
                        index = GenericUtils.skipToChar(data, myRC.getIntValue(), HttpBaseMessage.COMMA) + 1;
                    } else {
                        bStarApproved = true;
                    }
                    continue;
                }

                // compare the name, check for the x-gzip type values
                if (index < data.length && ('x' == data[index] || 'X' == data[index])) {

                    if (++index < data.length && '-' == data[index]) {
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, "skipping past [x-]");
                        }
                        index++;
                    } else {
                        // not x-, go back one for the name comparison
                        index--;
                    }
                }
                for (x = 0; x < name.length && index < data.length; x++, index++) {
                    if (name[x] != data[index]) {
                        // try the alternate case for a match
                        if (GenericUtils.reverseCase(name[x]) != data[index]) {
                            // no match found, break out of for loop
                            break;
                        }
                    }
                }

                // check for the explicit failed match
                if (x != name.length) {
                    // didn't find a match, skip to the next comma
                    index = GenericUtils.skipToChar(data, index, HttpBaseMessage.COMMA) + 1;
                    continue;
                }

                // name match so far. If the next char is a comma, then no qvalue
                // and this compression is allowed. If it is a semi-colon, then
                // a qvalue is following. Anything else and this wasn't a full
                // match
                index = skipWhiteSpace(data, index);
                if (index < data.length && HttpBaseMessage.COMMA == data[index]) {
                    // this is allowed
                    rc = true;
                } else if (index < data.length && BNFHeaders.SEMICOLON == data[index]) {
                    // parse the qvalue
                    ReturnCodes myRC = parseQValue(data, ++index);
                    rc = myRC.getBooleanValue();
                } else if (index >= data.length) {
                    // end of data... means we had a full match
                    rc = true;
                } else {
                    // partial match... gzip against gzipMe
                    index = GenericUtils.skipToChar(data, index, HttpBaseMessage.COMMA) + 1;
                    continue;
                }

                break; // out of while loop
            }
        } else {
            // a null (non present) header means that all encodings are accepted
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Accept-Encoding header not present");
            }
            rc = true;
        }

        if (!rc && bStarFound && bStarApproved) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "No explicit match, but wildcard was found");
            }
            rc = true;
        }

        this.bCheckedAcceptEncoding = true;
        this.bCompressionAllowed = rc;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "isCompressionAllowed(3): " + rc);
        }
        return rc;
    }
282850
public boolean isMethodSupported(String methodName,
                                   Class<?>... parameterTypes)
  throws IOException {
    if (serverMethods == null) { // client & server have the same protocol
      return true;
    }
    Method method;
    try {
      method = protocol.getDeclaredMethod(methodName, parameterTypes);
    } catch (SecurityException e) {
      throw new IOException(e);
    } catch (NoSuchMethodException e) {
      throw new IOException(e);
    }
    return serverMethods.contains(
        Integer.valueOf(ProtocolSignature.getFingerprint(method)));
  }
565913
protected static boolean isRecoverableException(AmazonServiceException ex) {
		if (ex.getErrorType() == null) {
			return false;
		}

		switch (ex.getErrorType()) {
			case Client:
				return ex instanceof ProvisionedThroughputExceededException;
			case Service:
			case Unknown:
				return true;
			default:
				return false;
		}
	}
444565
public boolean hasUnsupportedCriticalExtension() {
        if (info == null)
            return false;
        try {
            CertificateExtensions exts = (CertificateExtensions)info.get(
                                         CertificateExtensions.NAME);
            if (exts == null)
                return false;
            return exts.hasUnsupportedCriticalExtension();
        } catch (Exception e) {
            return false;
        }
    }
207537
@SuppressWarnings("unchecked")
    @Override
    public <T> T transport(String methodName, Object[] args, Attachment attachment)
            throws Throwable {
        if (NaviProtocol.JSON.equals(serializeHandler.getProtocol())) {
            throw new CodecException(
                    "Json protocol not supported through transport(java.lang.String, java.lang.Object[]) method");
        }
        return (T) transport(methodName, args, null, null, attachment);
    }
1074294
private boolean isHtmlAcceptable(HttpServletRequest request)
	{
		@SuppressWarnings("unchecked") final List<String> accepts = ListUtility.list(ListUtility.iterate(request.getHeaders(
				HttpHeaderNames.ACCEPT)));

		for (String accept : accepts)
		{
			if (StringUtils.startsWithIgnoreCase(accept, "text/html"))
				return true;
		}

		return false;
	}
45340
private static boolean isAdaptiveException(Throwable t) {
        if (t instanceof FrameTooLongException) {
            return true;
        }

        if (t instanceof NoHostAvailableException) {
            // If the issue on every host is adaptive then the exception is adaptive
            Collection<Throwable> hostExceptions = ((NoHostAvailableException) t).getErrors().values();
            return !hostExceptions.isEmpty() && hostExceptions.stream().allMatch(AdaptiveResultSet::isAdaptiveException);
        }

        return false;
    }
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;
    }
437809
public static final boolean isStoredProcThrowableFatalToServer(Throwable th) {
        if (th instanceof LinkageError || th instanceof AssertionError) {
            return false;
        }
        if (th instanceof Exception) {
            return false;
        }
        return true;
    }
158138
public static boolean isSupportedRasterExtension( String name ) {
        for( String ext : supportedRasters ) {
            if (name.toLowerCase().endsWith(ext)) {
                return true;
            }
        }
        return false;
    }
422615
@SuppressWarnings("null")
  private boolean accepts(SlingHttpServletRequest request) {
    return request.getMethod().equalsIgnoreCase(METHOD_GET)
        && request.getResource() != null
        && StringUtils.equals(request.getResource().getValueMap().get(JCR_PRIMARYTYPE, String.class), NT_FILE);
  }
275372
public boolean isAvailable(String resource) {
        final boolean isAnyTraceEnabled = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
        if (isAnyTraceEnabled && logger.isLoggable(Level.FINER)) {
            logger.entering(CLASS_NAME, "isAvailable", "resource [" + resource + "] ");
        } //d651265
        boolean available = false;
        // not sure if needed; after first check for isAvailable, welcome file
        // goes directly to wrapper; can this ever be true?
        RequestProcessor rp = extensionContext.getMappingTarget(resource);
        available = (rp instanceof IServletWrapper); // true if wrapper has
                                                     // already been created.

        if (available == false) {
            if (jspOptions.isDisableJspRuntimeCompilation() == false) {
                try {
                    available = handleCaseSensitivityCheck(resource, false); //PK81387 - passing false
                } catch (IOException io) {
                    available = false;
                }
            } else {
                JspInputSource inputSource = context.getJspInputSourceFactory().createJspInputSource(resource);
                JspResources jspResources = context.getJspResourcesFactory().createJspResources(inputSource);

                String classname = jspResources.getClassName();
                String generatedSourceDir = jspResources.getGeneratedSourceFile().getParent();
                if (generatedSourceDir.endsWith(File.separator) == false) {
                    generatedSourceDir = generatedSourceDir + File.separator;
                }
                File tempDirJSP = new File(generatedSourceDir + classname + ".class");
                available = tempDirJSP.exists();

                if (available == false) {

                    String jspUri = inputSource.getRelativeURL();
                    if (jspUri.charAt(0) != '/') {
                        jspUri = "/" + jspUri;
                    }
                    String webinfClassFilePath = null;
                    File webinfClassFile = null;
                    String packageName = null;
                    if (jspOptions.isUseFullPackageNames() == false) {
                        webinfClassFilePath = context.getRealPath("/WEB-INF/classes") + jspUri.substring(0, jspUri.lastIndexOf("/") + 1);
                        webinfClassFile = new File(webinfClassFilePath + File.separator + classname + ".class");
                    } else {
                        packageName = jspResources.getPackageName();
                        String packageDir = packageName.replace('.', '/');
                        webinfClassFilePath = context.getRealPath("/WEB-INF/classes") + "/" + packageDir;
                        webinfClassFile = new File(webinfClassFilePath + File.separator + classname + ".class");
                    }
                    available = webinfClassFile.exists();
                }
            }
        }
        if (isAnyTraceEnabled && logger.isLoggable(Level.FINE)) {
            logger.exiting(CLASS_NAME, "isAvailable", "resource [" + resource + "] is available? [" + available + "]");
        } //d651265
        return available;

    }
367775
private boolean hasExpandableVarArgs(IMockMethod method, List<Object> args) {
    List<Class<?>> paramTypes = method.getParameterTypes();
    return !paramTypes.isEmpty()
        && CollectionUtil.getLastElement(paramTypes).isArray()
        && CollectionUtil.getLastElement(args) != null;
  }
478308
public boolean isMultiSelectable() {
        return ((!isInPk() && !isInFk() && !isVersion()) || (isSimplePk() && jpa.isManuallyAssigned())) //
                && (isBoolean() || isEnum() || isString() || isNumeric());
    }