/** * Return the default directory from where files will be serviced. * @return the default directory from where file will be serviced. */ @SuppressWarnings("UnusedDeclaration") public File getDefaultDocRoot() { final File[] array = docRoots.getArray(); return (array != null && array.length > 0) ? array[0] : null; }
/** * {@inheritDoc} */ @Override public final void addProbes(final E... probes) { monitoringProbes.addAll(probes); }
/** * Return the array of the registered {@link AddOn}s. * Please note, possible array modifications wont affect the * {@link NetworkListener}'s addons list. * * @return the array of the registered {@link AddOn}s. */ public AddOn[] getAddOns() { return addons.obtainArrayCopy(); }
/** * Returns <tt>true</tt> if the resource with the given content-type * could be compressed, or <tt>false</tt> otherwise. */ public boolean checkMimeType(final String contentType) { return (compressibleMimeTypes.isEmpty() || indexOfStartsWith(compressibleMimeTypes.getArray(), contentType) != -1); }
/** * Add the directory to the list of directories where files will be serviced from. * * @param docRoot the directory to be added to the list of directories * where files will be serviced from. */ public final void addDocRoot(File docRoot) { docRoots.add(docRoot); }
/** * Deregisters {@link AddOn} from this NetworkListener. * @param addon the {@link AddOn} to deregister. * * @return <tt>true</tt>, if the {@link AddOn} was successfully removed, or * <tt>false</tt> the the {@link AddOn} wasn't registered on the * NetworkListener. */ public boolean deregisterAddOn(final AddOn addon) { return addons.remove(addon); }
/** * {@inheritDoc} */ @Override public final void clearProbes() { monitoringProbes.clear(); }
/** * {@inheritDoc} */ @Override public boolean isEmpty() { return size() == 0; }
/** * {@inheritDoc} */ @Override public boolean remove(Object o) { return removeAll(o); }
public DefaultMonitoringConfig(final Class<E> clazz) { monitoringProbes = new ArraySet<E>(clazz); }
/** * Returns <tt>true</tt> if the resource with the given content-type * could be compressed, or <tt>false</tt> otherwise. */ public boolean checkMimeType(final String contentType) { return (compressibleMimeTypes.isEmpty() || indexOfStartsWith(compressibleMimeTypes.getArray(), contentType) != -1); }
/** * Registers {@link AddOn} on this NetworkListener. * @param addon the {@link AddOn} to be registered. * * @return <tt>true</tt>, if the {@link AddOn} wasn't registered before, * otherwise the existing {@link AddOn} will be replaced and this method * returns <tt>false</tt>. */ public boolean registerAddOn(final AddOn addon) { return addons.add(addon); }
/** * Removes the directory from the list of directories where static files will be serviced from. * * @param docRoot the directory to remove. */ @SuppressWarnings("UnusedDeclaration") public void removeDocRoot(File docRoot) { docRoots.remove(docRoot); }
/** * {@inheritDoc} */ @Override public final void clearProbes() { monitoringProbes.clear(); }
/** * {@inheritDoc} */ @Override public boolean isEmpty() { return size() == 0; }
/** * {@inheritDoc} */ @Override public final boolean removeProbes(final E... probes) { return monitoringProbes.removeAll(probes); }
public DefaultMonitoringConfig(final Class<E> clazz) { monitoringProbes = new ArraySet<E>(clazz); }
/** * Returns <tt>true</tt> if the resource with the given content-type * could be compressed, or <tt>false</tt> otherwise. */ public boolean checkMimeType(final String contentType) { return (compressibleMimeTypes.isEmpty() || indexOfStartsWith(compressibleMimeTypes.getArray(), contentType) != -1); }
/** * {@inheritDoc} */ @Override public final void addProbes(final E... probes) { monitoringProbes.addAll(probes); }
/** * {@inheritDoc} */ @Override public final E[] getProbes() { return monitoringProbes.obtainArrayCopy(); }