code
stringlengths
73
34.1k
label
stringclasses
1 value
protected Class<?> defineClass(String name, sun.misc.Resource res) throws IOException { final int i = name.lastIndexOf('.'); final URL url = res.getCodeSourceURL(); if (i != -1) { final String pkgname = name.substring(0, i); // Check if package already loaded. final Package pkg = getPackage(pkgname); ...
java
@SuppressWarnings("checkstyle:npathcomplexity") protected Package definePackage(String name, Manifest man, URL url) throws IllegalArgumentException { final String path = name.replace('.', '/').concat("/"); //$NON-NLS-1$ String specTitle = null; String specVersion = null; String specVendor = null; String impl...
java
@Override @Pure public URL findResource(final String name) { /* * The same restriction to finding classes applies to resources */ final URL url = AccessController.doPrivileged(new PrivilegedAction<URL>() { @Override public URL run() { return DynamicURLClassLoader.this.ucp.findResource(name, tru...
java
@Override @Pure public Enumeration<URL> findResources(final String name) throws IOException { final Enumeration<?> e = this.ucp.findResources(name, true); return new Enumeration<URL>() { private URL url; private boolean next() { if (this.url != null) { return true; } do { final URL u...
java
@Override protected PermissionCollection getPermissions(CodeSource codesource) { final PermissionCollection perms = super.getPermissions(codesource); final URL url = codesource.getLocation(); Permission permission; URLConnection urlConnection; try { urlConnection = url.openConnection(); permission =...
java
private static URL[] mergeClassPath(URL... urls) { final String path = System.getProperty("java.class.path"); //$NON-NLS-1$ final String separator = System.getProperty("path.separator"); //$NON-NLS-1$ final String[] parts = path.split(Pattern.quote(separator)); final URL[] u = new URL[parts.length +...
java
public static <E> int remove(List<E> list, Comparator<? super E> comparator, E data) { assert list != null; assert comparator != null; assert data != null; int first = 0; int last = list.size() - 1; while (last >= first) { final int center = (first + last) / 2; final E dt = list.get(center); final ...
java
@Inline(value = "add($1, $2, $3, false, false)") public static <E> int addIfAbsent(List<E> list, Comparator<? super E> comparator, E data) { return add(list, comparator, data, false, false); }
java
public static <E> int add(List<E> list, Comparator<? super E> comparator, E data, boolean allowMultipleOccurencesOfSameValue, boolean allowReplacement) { assert list != null; assert comparator != null; assert data != null; int first = 0; int last = list.size() - 1; while (last >= first) { final int ce...
java
@Pure public static <E> boolean contains(List<E> list, Comparator<? super E> comparator, E data) { assert list != null; assert comparator != null; assert data != null; int first = 0; int last = list.size() - 1; while (last >= first) { final int center = (first + last) / 2; final E dt = list.get(cente...
java
public static <T> Iterator<T> reverseIterator(final List<T> list) { return new Iterator<T>() { private int next = list.size() - 1; @Override @Pure public boolean hasNext() { return this.next >= 0; } @Override public T next() { final int n = this.next; --this.next; try { re...
java
@Pure public static Class<?> getAttributeClassWithDefault(Node document, boolean caseSensitive, Class<?> defaultValue, String... path) { assert document != null : AssertMessages.notNullParameter(0); final String v = getAttributeValue(document, caseSensitive, 0, path); if (v != null && !v.isEmpty()) { try {...
java
@Pure public static <T extends Node> T getChild(Node parent, Class<T> type) { assert parent != null : AssertMessages.notNullParameter(0); assert type != null : AssertMessages.notNullParameter(1); final NodeList children = parent.getChildNodes(); final int len = children.getLength(); for (int i = 0; i < len; ...
java
@Pure public static Document getDocumentFor(Node node) { Node localnode = node; while (localnode != null) { if (localnode instanceof Document) { return (Document) localnode; } localnode = localnode.getParentNode(); } return null; }
java
@Pure public static String getText(Node document, String... path) { assert document != null : AssertMessages.notNullParameter(0); Node parentNode = getNodeFromPath(document, path); if (parentNode == null) { parentNode = document; } final StringBuilder text = new StringBuilder(); final NodeList children ...
java
@Pure public static Iterator<Node> iterate(Node parent, String nodeName) { assert parent != null : AssertMessages.notNullParameter(0); assert nodeName != null && !nodeName.isEmpty() : AssertMessages.notNullParameter(0); return new NameBasedIterator(parent, nodeName); }
java
@Pure public static Object parseObject(String xmlSerializedObject) throws IOException, ClassNotFoundException { assert xmlSerializedObject != null : AssertMessages.notNullParameter(0); try (ByteArrayInputStream bais = new ByteArrayInputStream(Base64.getDecoder().decode(xmlSerializedObject))) { final ObjectInput...
java
@Pure public static byte[] parseString(String text) { return Base64.getDecoder().decode(Strings.nullToEmpty(text).trim()); }
java
@Pure public static Document parseXML(String xmlString) { assert xmlString != null : AssertMessages.notNullParameter(0); try { return readXML(new StringReader(xmlString)); } catch (Exception e) { // } return null; }
java
public static void writeResources(Element node, XMLResources resources, XMLBuilder builder) { if (resources != null) { final Element resourcesNode = builder.createElement(NODE_RESOURCES); for (final java.util.Map.Entry<Long, Entry> pair : resources.getPairs().entrySet()) { final Entry e = pair.getValue(); ...
java
@Pure public static URL readResourceURL(Element node, XMLResources resources, String... path) { final String stringValue = getAttributeValue(node, path); if (XMLResources.isStringIdentifier(stringValue)) { try { final long id = XMLResources.getNumericalIdentifier(stringValue); return resources.getResour...
java
protected static StackTraceElement getTraceElementAt(int level) { if (level < 0) { return null; } try { final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); int j = -1; boolean found = false; Class<?> type; for (int i = 0; i < stackTrace.length; ++i) { if (found) { ...
java
public boolean moveTo(N newParent) { if (newParent == null) { return false; } return moveTo(newParent, newParent.getChildCount()); }
java
public final boolean addChild(int index, N newChild) { if (newChild == null) { return false; } final int count = (this.children == null) ? 0 : this.children.size(); final N oldParent = newChild.getParentNode(); if (oldParent != this && oldParent != null) { newChild.removeFromParent(); } final int...
java
public static final <T extends Comparable<T>> Ordering<Scored<T>> ByScoreThenByItem( Ordering<T> itemOrdering) { final Ordering<Scored<T>> byItem = itemOrdering.onResultOf(Scoreds.<T>itemsOnly()); final Ordering<Scored<T>> byScore = Scoreds.<T>ByScoreOnly(); return Ordering.compound(ImmutableList.of(...
java
public static final <T extends Comparable<T>> Ordering<Scored<T>> ByScoreThenByItem() { final Ordering<Scored<T>> byItem = Scoreds.<T>ByItemOnly(); final Ordering<Scored<T>> byScore = Scoreds.<T>ByScoreOnly(); return Ordering.compound(ImmutableList.of(byScore, byItem)); }
java
protected void onFileChoose(JFileChooser fileChooser, ActionEvent actionEvent) { final int returnVal = fileChooser.showOpenDialog(parent); if (returnVal == JFileChooser.APPROVE_OPTION) { final File file = fileChooser.getSelectedFile(); onApproveOption(file, actionEvent); } else { onCancel(actionE...
java
LayoutProcessorOutput applyLayout(FileResource resource, Locale locale, Map<String, Object> model) { Optional<Path> layout = findLayout(resource); return layout.map(Path::toString)// .map(Files::getFileExtension)// .map(layoutEngines::get) // .orElse(lParam -> new LayoutProcess...
java
@Deprecated public Timex2Time modifiedCopy(final Modifier modifier) { return new Timex2Time(val, modifier, set, granularity, periodicity, anchorVal, anchorDir, nonSpecific); }
java
@Pure public static MACNumber[] parse(String addresses) { if ((addresses == null) || ("".equals(addresses))) { //$NON-NLS-1$ return new MACNumber[0]; } final String[] adrs = addresses.split(Pattern.quote(Character.toString(MACNUMBER_SEPARATOR))); final List<MACNumber> list = new ArrayList<>(); for (final ...
java
@Pure public static String join(MACNumber... addresses) { if ((addresses == null) || (addresses.length == 0)) { return null; } final StringBuilder buf = new StringBuilder(); for (final MACNumber number : addresses) { if (buf.length() > 0) { buf.append(MACNUMBER_SEPARATOR); } buf.append(number);...
java
@Pure public static Collection<MACNumber> getAllAdapters() { final List<MACNumber> av = new ArrayList<>(); final Enumeration<NetworkInterface> interfaces; try { interfaces = NetworkInterface.getNetworkInterfaces(); } catch (SocketException exception) { return av; } if (interfaces != null) { Networ...
java
@Pure public static Map<InetAddress, MACNumber> getAllMappings() { final Map<InetAddress, MACNumber> av = new HashMap<>(); final Enumeration<NetworkInterface> interfaces; try { interfaces = NetworkInterface.getNetworkInterfaces(); } catch (SocketException exception) { return av; } if (interfaces != n...
java
@Pure public static MACNumber getPrimaryAdapter() { final Enumeration<NetworkInterface> interfaces; try { interfaces = NetworkInterface.getNetworkInterfaces(); } catch (SocketException exception) { return null; } if (interfaces != null) { NetworkInterface inter; while (interfaces.hasMoreElements(...
java
@Pure public static Collection<InetAddress> getPrimaryAdapterAddresses() { final Enumeration<NetworkInterface> interfaces; try { interfaces = NetworkInterface.getNetworkInterfaces(); } catch (SocketException exception) { return Collections.emptyList(); } if (interfaces != null) { NetworkInterface in...
java
@Pure public boolean isNull() { for (int i = 0; i < this.bytes.length; ++i) { if (this.bytes[i] != 0) { return false; } } return true; }
java
public Optional<Path> getSourcePath() { File f = this.nytdoc.getSourceFile(); return f == null ? Optional.empty() : Optional.of(f.toPath()); }
java
public Optional<URL> getUrl() { URL u = this.nytdoc.getUrl(); return Optional.ofNullable(u); }
java
public void load(File authorizationFile) throws AuthorizationFileException { FileInputStream fis = null; try { fis = new FileInputStream(authorizationFile); ANTLRInputStream stream = new ANTLRInputStream(fis); SAFPLexer lexer = new SAFPLexer(stream); Commo...
java
public static void deleteAlias(final File keystoreFile, String alias, final String password) throws NoSuchAlgorithmException, CertificateException, FileNotFoundException, KeyStoreException, IOException { KeyStore keyStore = KeyStoreFactory.newKeyStore(KeystoreType.JKS.name(), password, keystoreFile); keySt...
java
@Nonnull public static EChange setResponseCompressionEnabled (final boolean bResponseCompressionEnabled) { return s_aRWLock.writeLocked ( () -> { if (s_bResponseCompressionEnabled == bResponseCompressionEnabled) return EChange.UNCHANGED; s_bResponseCompressionEnabled = bResponseCompressionEn...
java
@Nonnull public static EChange setDebugModeEnabled (final boolean bDebugModeEnabled) { return s_aRWLock.writeLocked ( () -> { if (s_bDebugModeEnabled == bDebugModeEnabled) return EChange.UNCHANGED; s_bDebugModeEnabled = bDebugModeEnabled; LOGGER.info ("CompressFilter debugMode=" + bDeb...
java
@Override public SAMFileHeader makeSAMFileHeader(ReadGroupSet readGroupSet, List<Reference> references) { return ReadUtils.makeSAMFileHeader(readGroupSet, references); }
java
public boolean hasUser(String userName) { boolean result = false; for (User item : getUsersList()) { if (item.getName().equals(userName)) { result = true; } } return result; }
java
public User getUser(String userName) { User result = null; for (User item : getUsersList()) { if (item.getName().equals(userName)) { result = item; } } return result; }
java
@Nonnull public CSP2SourceList addScheme (@Nonnull @Nonempty final String sScheme) { ValueEnforcer.notEmpty (sScheme, "Scheme"); ValueEnforcer.isTrue (sScheme.length () > 1 && sScheme.endsWith (":"), () -> "Passed scheme '" + sScheme + "' is invalid!"); m_aList.add (sScheme); ...
java
public final void setProxy (@Nullable final HttpHost aProxy, @Nullable final Credentials aProxyCredentials) { m_aProxy = aProxy; m_aProxyCredentials = aProxyCredentials; }
java
@Nonnull public final HttpClientFactory setRetries (@Nonnegative final int nRetries) { ValueEnforcer.isGE0 (nRetries, "Retries"); m_nRetries = nRetries; return this; }
java
@Nonnull public final HttpClientFactory setRetryMode (@Nonnull final ERetryMode eRetryMode) { ValueEnforcer.notNull (eRetryMode, "RetryMode"); m_eRetryMode = eRetryMode; return this; }
java
@Nullable public static String dnsResolve (@Nonnull final String sHostName) { final InetAddress aAddress = resolveByName (sHostName); if (aAddress == null) return null; return new IPV4Addr (aAddress.getAddress ()).getAsString (); }
java
@Nonnull @OverrideOnDemand public EContinue onFilterBefore (@Nonnull final HttpServletRequest aHttpRequest, @Nonnull final HttpServletResponse aHttpResponse, @Nonnull final IRequestWebScope aRequestScope) throws IOException, ServletException { ...
java
public boolean supportsMimeType (@Nullable final IMimeType aMimeType) { if (aMimeType == null) return false; return getQValueOfMimeType (aMimeType).isAboveMinimumQuality (); }
java
public void configure(String rootUrl, Settings settings) { Data<Read, ReadGroupSet, Reference> data = dataSources.get(rootUrl); if (data == null) { data = new Data<Read, ReadGroupSet, Reference>(settings, null); dataSources.put(rootUrl, data); } else { data.settings = settings; } }
java
public GenomicsDataSource<Read, ReadGroupSet, Reference> get(String rootUrl) { Data<Read, ReadGroupSet, Reference> data = dataSources.get(rootUrl); if (data == null) { data = new Data<Read, ReadGroupSet, Reference>(new Settings(), null); dataSources.put(rootUrl, data); } if (data.dataSource ...
java
@Nonnull public EChange setConnectionTimeoutMilliSecs (final long nMilliSecs) { if (m_nConnectionTimeoutMilliSecs == nMilliSecs) return EChange.UNCHANGED; m_nConnectionTimeoutMilliSecs = nMilliSecs; return EChange.CHANGED; }
java
@Nonnull public EChange setTimeoutMilliSecs (final long nMilliSecs) { if (m_nTimeoutMilliSecs == nMilliSecs) return EChange.UNCHANGED; m_nTimeoutMilliSecs = nMilliSecs; return EChange.CHANGED; }
java
@Nonnull @ReturnsMutableCopy public static HttpHeaderMap getResponseHeaderMap (@Nonnull final HttpServletResponse aHttpResponse) { ValueEnforcer.notNull (aHttpResponse, "HttpResponse"); final HttpHeaderMap ret = new HttpHeaderMap (); for (final String sName : aHttpResponse.getHeaderNames ()) fo...
java
@Nonnull public final UnifiedResponse setContentAndCharset (@Nonnull final String sContent, @Nonnull final Charset aCharset) { ValueEnforcer.notNull (sContent, "Content"); setCharset (aCharset); setContent (sContent.getBytes (aCharset)); return this; }
java
@Nonnull public final UnifiedResponse setContent (@Nonnull final IHasInputStream aISP) { ValueEnforcer.notNull (aISP, "InputStreamProvider"); if (hasContent ()) logInfo ("Overwriting content with content provider!"); m_aContentArray = null; m_nContentArrayOfs = -1; m_nContentArrayLength = ...
java
@Nonnull public final UnifiedResponse setContentDispositionFilename (@Nonnull @Nonempty final String sFilename) { ValueEnforcer.notEmpty (sFilename, "Filename"); // Ensure that a valid filename is used // -> Strip all paths and replace all invalid characters final String sFilenameToUse = FilenameHe...
java
@Nonnull public final UnifiedResponse removeCaching () { // Remove any eventually set headers removeExpires (); removeCacheControl (); removeETag (); removeLastModified (); m_aResponseHeaderMap.removeHeaders (CHttpHeader.PRAGMA); return this; }
java
@Nonnull public final UnifiedResponse disableCaching () { // Remove any eventually set headers removeCaching (); if (m_eHttpVersion.is10 ()) { // Set to expire far in the past for HTTP/1.0. m_aResponseHeaderMap.setHeader (CHttpHeader.EXPIRES, ResponseHelperSettings.EXPIRES_NEVER_STRING)...
java
@Nonnull public final UnifiedResponse enableCaching (@Nonnegative final int nSeconds) { ValueEnforcer.isGT0 (nSeconds, "Seconds"); // Remove any eventually set headers // Note: don't remove Last-Modified and ETag! removeExpires (); removeCacheControl (); m_aResponseHeaderMap.removeHeaders (...
java
@Nonnull public final UnifiedResponse setStatusUnauthorized (@Nullable final String sAuthenticate) { _setStatus (HttpServletResponse.SC_UNAUTHORIZED); if (StringHelper.hasText (sAuthenticate)) m_aResponseHeaderMap.setHeader (CHttpHeader.WWW_AUTHENTICATE, sAuthenticate); return this; }
java
public final void setCustomResponseHeaders (@Nullable final HttpHeaderMap aOther) { m_aResponseHeaderMap.removeAll (); if (aOther != null) m_aResponseHeaderMap.setAllHeaders (aOther); }
java
static private JsonTransformer factory(Object jsonObject) throws InvalidTransformerException { if (jsonObject instanceof JSONObject) { return factory((JSONObject)jsonObject); } else if (jsonObject instanceof JSONArray) { return factory((JSONArray)jsonObject); } ...
java
public void invalidate () { if (m_bInvalidated) throw new IllegalStateException ("Request scope already invalidated!"); m_bInvalidated = true; if (m_aServletContext != null) { final ServletRequestEvent aSRE = new ServletRequestEvent (m_aServletContext, this); for (final ServletReque...
java
@Nonnull public QValue getQValueOfEncoding (@Nonnull final String sEncoding) { ValueEnforcer.notNull (sEncoding, "Encoding"); // Direct search encoding QValue aQuality = m_aMap.get (_unify (sEncoding)); if (aQuality == null) { // If not explicitly given, check for "*" aQuality = m_a...
java
public void bind() { program.use(); if (textures != null) { final TIntObjectIterator<Texture> iterator = textures.iterator(); while (iterator.hasNext()) { iterator.advance(); // Bind the texture to the unit final int unit = iterator...
java
public void setProgram(Program program) { if (program == null) { throw new IllegalStateException("Program cannot be null"); } program.checkCreated(); this.program = program; }
java
public void addTexture(int unit, Texture texture) { if (texture == null) { throw new IllegalStateException("Texture cannot be null"); } texture.checkCreated(); if (textures == null) { textures = new TIntObjectHashMap<>(); } textures.put(unit, textu...
java
@Override public boolean maybeAddRead(Read read) { if (!isUnmappedMateOfMappedRead(read)) { return false; } final String reference = read.getNextMatePosition().getReferenceName(); String key = getReadKey(read); Map<String, ArrayList<Read>> reads = unmappedReads.get(reference); if (reads ...
java
@Override public ArrayList<Read> getUnmappedMates(Read read) { if (read.getNumberReads() < 2 || (read.hasNextMatePosition() && read.getNextMatePosition() != null) || !read.hasAlignment() || read.getAlignment() == null || !read.getAlignment().hasPosition() || read.getAlignment().getPosition...
java
public static void setSessionPassivationAllowed (final boolean bSessionPassivationAllowed) { s_aSessionPassivationAllowed.set (bSessionPassivationAllowed); if (LOGGER.isInfoEnabled ()) LOGGER.info ("Session passivation is now " + (bSessionPassivationAllowed ? "enabled" : "disabled")); // For passiv...
java
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetOrCreateSessionScope (@Nonnull final HttpSession aHttpSession, final boolean bCreateIfNotExisting, ...
java
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (final boolean bCreateIfNotExisting, final boolean bItsOkayToCreateANewSession) { // Try to to resolve the current request scope...
java
@Nullable @DevelopersNote ("This is only for project-internal use!") public static ISessionWebScope internalGetSessionScope (@Nullable final IRequestWebScope aRequestScope, final boolean bCreateIfNotExisting, ...
java
public ByteBuffer getIndicesBuffer() { final ByteBuffer buffer = CausticUtil.createByteBuffer(indices.size() * DataType.INT.getByteSize()); for (int i = 0; i < indices.size(); i++) { buffer.putInt(indices.get(i)); } buffer.flip(); return buffer; }
java
public void addAttribute(int index, VertexAttribute attribute) { attributes.put(index, attribute); nameToIndex.put(attribute.getName(), index); }
java
public int getAttributeSize(int index) { final VertexAttribute attribute = getAttribute(index); if (attribute == null) { return -1; } return attribute.getSize(); }
java
public DataType getAttributeType(int index) { final VertexAttribute attribute = getAttribute(index); if (attribute == null) { return null; } return attribute.getType(); }
java
public String getAttributeName(int index) { final VertexAttribute attribute = getAttribute(index); if (attribute == null) { return null; } return attribute.getName(); }
java
public ByteBuffer getAttributeBuffer(int index) { final VertexAttribute attribute = getAttribute(index); if (attribute == null) { return null; } return attribute.getData(); }
java
public void copy(VertexData data) { clear(); indices.addAll(data.indices); final TIntObjectIterator<VertexAttribute> iterator = data.attributes.iterator(); while (iterator.hasNext()) { iterator.advance(); attributes.put(iterator.key(), iterator.value().clone()); ...
java
@Nonnull public QValue getQValueOfLanguage (@Nonnull final String sLanguage) { ValueEnforcer.notNull (sLanguage, "Language"); // Find language direct QValue aQuality = m_aMap.get (_unify (sLanguage)); if (aQuality == null) { // If not explicitly given, check for "*" aQuality = m_aMa...
java
public void setVertexArray(VertexArray vertexArray) { if (vertexArray == null) { throw new IllegalArgumentException("Vertex array cannot be null"); } vertexArray.checkCreated(); this.vertexArray = vertexArray; }
java
public Matrix4f getMatrix() { if (updateMatrix) { final Matrix4f matrix = Matrix4f.createScaling(scale.toVector4(1)).rotate(rotation).translate(position); if (parent == null) { this.matrix = matrix; } else { childMatrix = matrix; } ...
java
public void setParent(Model parent) { if (parent == this) { throw new IllegalArgumentException("The model can't be its own parent"); } if (parent == null) { this.parent.children.remove(this); } else { parent.children.add(this); } this.p...
java
public boolean hasAlias(String aliasName) { boolean result = false; for (Alias item : getAliasesList()) { if (item.getName().equals(aliasName)) { result = true; } } return result; }
java
@Nullable public static String encode (@Nullable final String sValue, @Nonnull final Charset aCharset, final ECodec eCodec) { if (sValue == null) return null; try { switch (eCodec) { case Q: return new RFC1522QCodec (aCharset).getEncoded (sValue); case B: ...
java
@Nullable public static String decode (@Nullable final String sValue) { if (sValue == null) return null; try { // try BCodec first return new RFC1522BCodec ().getDecoded (sValue); } catch (final DecodeException de) { // try QCodec next try { retur...
java
public static void addRequest (@Nonnull @Nonempty final String sRequestID, @Nonnull final IRequestWebScope aRequestScope) { getInstance ().m_aRequestTrackingMgr.addRequest (sRequestID, aRequestScope, s_aParallelRunningCallbacks); }
java
public static void removeRequest (@Nonnull @Nonempty final String sRequestID) { final RequestTracker aTracker = getGlobalSingletonIfInstantiated (RequestTracker.class); if (aTracker != null) aTracker.m_aRequestTrackingMgr.removeRequest (sRequestID, s_aParallelRunningCallbacks); }
java
@Nonnull public ESuccess queueMail (@Nonnull final ISMTPSettings aSMTPSettings, @Nonnull final IMutableEmailData aMailData) { return MailAPI.queueMail (aSMTPSettings, aMailData); }
java
@Nonnegative public int queueMails (@Nonnull final ISMTPSettings aSMTPSettings, @Nonnull final Collection <? extends IMutableEmailData> aMailDataList) { return MailAPI.queueMails (aSMTPSettings, aMailDataList); }
java
public static void setPerformMXRecordCheck (final boolean bPerformMXRecordCheck) { s_aPerformMXRecordCheck.set (bPerformMXRecordCheck); if (LOGGER.isInfoEnabled ()) LOGGER.info ("Email address record check is " + (bPerformMXRecordCheck ? "enabled" : "disabled")); }
java
private static boolean _hasMXRecord (@Nonnull final String sHostName) { try { final Record [] aRecords = new Lookup (sHostName, Type.MX).run (); return aRecords != null && aRecords.length > 0; } catch (final Exception ex) { // Do not log this message, as this method is potentiall...
java
public static boolean isValid (@Nullable final String sEmail) { return s_aPerformMXRecordCheck.get () ? isValidWithMXCheck (sEmail) : EmailAddressHelper.isValid (sEmail); }
java
public static boolean isValidWithMXCheck (@Nullable final String sEmail) { // First check without MX if (!EmailAddressHelper.isValid (sEmail)) return false; final String sUnifiedEmail = EmailAddressHelper.getUnifiedEmailAddress (sEmail); // MX record checking final int i = sUnifiedEmail.in...
java
@Nullable public String getResponseBodyAsString (@Nonnull final Charset aCharset) { return m_aResponseBody == null ? null : new String (m_aResponseBody, aCharset); }
java