/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param uriMB URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(MessageBytes uriMB) { int type = uriMB.getType(); if (type == MessageBytes.T_CHARS) { return normalizeChars(uriMB.getCharChunk()); } else { return normalizeBytes(uriMB.getByteChunk()); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }
/** * Normalize URI. * <p> * This method normalizes "\", "//", "/./" and "/../". This method will * return false when trying to go above the root, or if the URI contains * a null byte. * * @param dataChunk URI to be normalized * @return <tt>true</tt> if normalization was successful, or <tt>false</tt> otherwise */ public static boolean normalize(final DataChunk dataChunk) { switch (dataChunk.getType()) { case Bytes: return normalizeBytes(dataChunk.getByteChunk()); case Buffer: return normalizeBuffer(dataChunk.getBufferChunk()); case String: try { dataChunk.toChars(null); } catch (CharConversionException unexpected) { // should never occur throw new IllegalStateException("Unexpected exception", unexpected); } // pass to Chars case case Chars: return normalizeChars(dataChunk.getCharChunk()); default: throw new NullPointerException(); } }