Check if the via header is external
@param viaHeader the via header to check
@return true if the via header is external, false otherwise
196226
public final boolean isViaHeaderExternal(ViaHeader viaHeader) {
		if (viaHeader != null) {
			return isExternal(viaHeader.getHost(), viaHeader.getPort(), viaHeader.getTransport());
		}
		return true;
	}
466762
public void readExternal(ObjectInput in) throws IOException,
			ClassNotFoundException {
		if(logger.isDebugEnabled()) {
            logger.debug("readExternal");
        }

		super.readExternal(in);
		String messageString = in.readUTF();
		try {
			message = SipFactoryImpl.messageFactory.createRequest(messageString);
		} catch (ParseException e) {
			throw new IllegalArgumentException("Message " + messageString + " previously serialized could not be reparsed", e);
		}
		boolean isLinkedRequestSerialized = in.readBoolean();
		if (isLinkedRequestSerialized) {
			linkedRequest = (SipServletRequestImpl) in.readObject();
		}
		createDialog = in.readBoolean();
		String routingDirectiveString = in.readUTF();
		if(!routingDirectiveString.equals("")) {
			routingDirective = SipApplicationRoutingDirective.valueOf(routingDirectiveString);
		}
		String routingStateString = in.readUTF();
		if(!routingStateString.equals("")) {
			routingState = RoutingState.valueOf(routingStateString);
		}
		boolean isRoutingRegionSet = in.readBoolean();
		if(isRoutingRegionSet) {
			routingRegion = (SipApplicationRoutingRegion) in.readObject();
		}
		isInitial = in.readBoolean();
		if(logger.isDebugEnabled()) {
            logger.debug("readExternal - isInitial=" + isInitial);
        }
		isFinalResponseGenerated = in.readBoolean();
		is1xxResponseGenerated = in.readBoolean();
	}
1176397
private boolean checkHeader(RandomAccessInputStream raf) throws FileNotFoundException, IOException
	{
		boolean retval = false;

		if (raf.length() > TAG_SIZE)
		{
			raf.seek(raf.length() - TAG_SIZE);
			byte[] buf = new byte[3];

			if (raf.read(buf) != 3)
			{
				throw new IOException("Error encountered reading ID3 header");
			}
			else
			{
				String result = new String(buf, 0, 3, ENC_TYPE);
				retval = result.equals(TAG_START);
			}
		}

		return retval;
	}
821670
public boolean isExternalizable(final ServerInformation serverInformation) {
        if (serverInformation == null) {
            return false;
        }

        if (serverInformation instanceof HadoopClusterInformation) {
            return true;
        }

        return false;
    }
652225
public function isHeader($isHeader = true)
        {
            foreach ($this->_cells as $cell) {
                $cell->isHeader($isHeader);
            }

            return $this;
        }
638259
public static boolean isPortletEnvSupported() {
        if (enabled == null) {
            synchronized (PortletSupport.class) {
                if (enabled == null) {
                    try {
                        PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext");
                        enabled = true;
                    } catch (Throwable ignored) {
                        enabled = false;
                    }
                }
            }
        }
        return enabled;
    }
1083704
public boolean readMessage(InputStream is, OutboxAmp outbox)
    throws IOException
  {    
    InH3 hIn = _hIn;
    
    if (is.available() < 0) {
      return false;
    }

    //hIn.initPacket(is);
    
    try {
      return readMessage(hIn, outbox);
    } finally {
      //outbox.setInbox(null);
    }
  }
986221
protected function checkIdParameter($by)
    {
        $allowedForBy = [
            'externalId',
            'id'
        ];

        if (!in_array($by, $allowedForBy, false)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Value "%s" for "by" param is not valid. Allowed values are %s.',
                    $by,
                    implode(', ', $allowedForBy)
                )
            );
        }

        return true;
    }
957878
private boolean shouldOmitPortInHostHeader(HttpUrl url) {
    return (url.scheme().equals("http") && url.port() == 80)
      || (url.scheme().equals("https") && url.port() == 443);
  }
662326
private boolean checkIfUpgradeHeaders(Map<String, String> headers) {
        // looking for two headers.
        // connection header with a value of "upgrade"
        // upgrade header with a value of "h2c"
        boolean connection_upgrade = false;
        boolean upgrade_h2c = false;
        String headerValue = null;
        Set<Entry<String, String>> headerEntrys = headers.entrySet();

        for (Entry<String, String> header : headerEntrys) {
            String name = header.getKey();
            //check if it's an HTTP2 non-secure upgrade connection.
            if (name.equalsIgnoreCase(CONSTANT_connection)) {
                headerValue = header.getValue();
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "connection header found with value: " + headerValue);
                }
                if (headerValue != null && headerValue.equalsIgnoreCase(CONSTANT_connection_value)) {
                    if (connection_upgrade == true) {
                        // should not have two of these, log debug and return false
                        // TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "malformed: second connection header found");
                        }
                        return false;
                    }
                    connection_upgrade = true;
                }
            }
            if (name.equalsIgnoreCase(CONSTANT_upgrade)) {
                headerValue = header.getValue();
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "upgrade header found with value: " + headerValue);
                }
                if (headerValue != null && headerValue.equalsIgnoreCase(CONSTANT_h2c)) {
                    if (upgrade_h2c == true) {
                        // should not have two of these, log debug and return false
                        // TODO: determine if we should throw an exception here, or if this error will be dealt with in subsequent processing
                        if (tc.isDebugEnabled()) {
                            Tr.debug(tc, "malformed: second upgrade header found");
                        }
                        return false;
                    }
                    upgrade_h2c = true;
                }
            }
        }

        if (connection_upgrade && upgrade_h2c) {
            return true;
        }
        return false;
    }
260317
private boolean bufferLocalFileHeader() throws IOException {
        buffer.reset();
        JarEntry jarEntry = virtualJarInputStream.getNextJarEntry();

        if (jarEntry == null) { return false; }

        currentEntry = new ProcessedEntry(jarEntry, totalRead);
        processedEntries.add(currentEntry);


        bufferInt(ZipEntry.LOCSIG);    // Local file header signature
        bufferShort(10);               // Extraction version
        bufferShort(0);                // Flags
        bufferShort(ZipEntry.STORED);  // Compression type
        bufferInt(jarEntry.getTime()); // Entry time
        bufferInt(0);                  // CRC
        bufferInt(0);                  // Compressed size
        bufferInt(0);                  // Uncompressed size
        byte[] nameBytes = jarEntry.getName().getBytes("UTF8");
        bufferShort(nameBytes.length); // Entry name length
        bufferShort(0);                // Extra length
        buffer(nameBytes);
        return true;
    }
1059996
private boolean bufferNextCentralFileHeader() throws IOException {
        buffer.reset();

        if (currentCentralEntryIdx == processedEntries.size()) { return false; }

        ProcessedEntry entry = processedEntries.get(currentCentralEntryIdx++);

        JarEntry jarEntry = entry.jarEntry;
        bufferInt(ZipEntry.CENSIG);       // Central file header signature
        bufferShort(10);                  // Version made by
        bufferShort(10);                  // Extraction version
        bufferShort(0);                   // Flags
        bufferShort(ZipEntry.STORED);     // Compression type
        bufferInt(jarEntry.getTime());    // Entry time
        bufferInt(entry.crc);             // CRC
        bufferInt(jarEntry.getSize());    // Compressed size
        bufferInt(jarEntry.getSize());    // Uncompressed size
        byte[] nameBytes = jarEntry.getName().getBytes("UTF8");
        bufferShort(nameBytes.length);    // Entry name length
        bufferShort(0);                   // Extra field length
        bufferShort(0);                   // File comment length
        bufferShort(0);                   // Disk number start
        bufferShort(0);                   // Internal file attributes
        bufferInt(0);                     // External file attributes
        bufferInt(entry.offset);          // Relative offset of local header
        buffer(nameBytes);
        return true;
    }
814395
public ViaHeader getLocalVia(String transport, String branch) {
		checkState();
		final ListeningPoint lp = provider.getListeningPoint(transport);
		if (lp != null) {
			try {
				return headerFactory.createViaHeader(lp.getIPAddress(), lp
						.getPort(), lp.getTransport(), branch);
			} catch (ParseException e) {
				tracer.severe(e.getMessage(), e);
			} catch (InvalidArgumentException e) {
				tracer.severe(e.getMessage(), e);
			}
		}
		return null;
	}
23000
public static function validate($viaPort) {
    if (preg_match('/^(?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63}:\d+$/', $viaPort)) {
      return TRUE;
    }
    if (preg_match('/([0-9a-fA-F\.:]+):\d+/', $viaPort, $matches)) {
      return filter_var($matches[1], FILTER_VALIDATE_IP) !== FALSE;
    }
    return FALSE;
  }
1306210
protected boolean isExternal(String namespace, String name) {
    String resolved = resolveNamespace(namespace, name);
    if (resolved != null) {
      return isExternal(getMetaStoreUtil().getTable(resolved, name));
    }
    return false;
  }
234661
public boolean isSupported(String fileName) {
		String extension = getExtension(fileName);

		return isInternalSupported(extension) || isExternalSupported(extension);
	}
641616
@Override
    public boolean hasProtocol(final Protocol p) throws IOException {
        if (p == null) {
            return false;
        }

        try {
            final Packet packet = getPacket(p);
            return packet != null;
        } catch (final Exception e) {
            return false;
        }
    }