Return-Path: X-Original-To: apmail-nifi-commits-archive@minotaur.apache.org Delivered-To: apmail-nifi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8DEB118C35 for ; Mon, 1 Feb 2016 23:28:49 +0000 (UTC) Received: (qmail 32059 invoked by uid 500); 1 Feb 2016 23:28:40 -0000 Delivered-To: apmail-nifi-commits-archive@nifi.apache.org Received: (qmail 32031 invoked by uid 500); 1 Feb 2016 23:28:40 -0000 Mailing-List: contact commits-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list commits@nifi.apache.org Received: (qmail 31923 invoked by uid 99); 1 Feb 2016 23:28:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 23:28:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E8F4E2C1F5B for ; Mon, 1 Feb 2016 23:28:39 +0000 (UTC) Date: Mon, 1 Feb 2016 23:28:39 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@nifi.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (NIFI-924) Add Camel support in NiFi MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NIFI-924?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D151272= 45#comment-15127245 ]=20 ASF GitHub Bot commented on NIFI-924: ------------------------------------- Github user PuspenduBanerjee commented on the pull request: https://github.com/apache/nifi/pull/197#issuecomment-178252892 =20 @joewitt For Non-Uniform charset attached piece should work. =20 ```java /** * @param rawBytes * @param patternToMatch * @return */ private static boolean matchPattern(byte[] rawBytes , final String = patternToMatch){ out.println("Pattern=3D "+patternToMatch); final Pattern pattern =3D Pattern.compile(patternToMatch); final int patternByteLength=3DpatternToMatch.getBytes().length; out.println("PatternByteLength=3D "+patternByteLength);=20 final int minSliceByteLength=3D2; final int sliceByteLength =3D patternByteLength > minSliceByteL= ength ? patternByteLength : minSliceByteLength; int offset =3D 0; while (offset <=3D rawBytes.length) { String s=3Dnew String(Arrays.copyOfRange(rawBytes, offset>p= atternByteLength? offset-(patternByteLength+1):0, (offset + sliceByteL= ength))); out.println("Retrieved byte[]=3D "+s); if (pattern.matcher(s).find()) { return true; } offset +=3D sliceByteLength; }; return false; } ``` =20 I tried with \: ```java matchPattern("I=E2=99=A5NY=E2=99=A5Y=E2=99=A5NABCDdkk;lskiepdmclod;die;= 'cnjywkl;sfdsXRSHSY=E2=99=A5=E2=99=A5Y".getBytes(), "=E2=99=A5=E2=99=A5Y"); ``` > Add Camel support in NiFi > ------------------------- > > Key: NIFI-924 > URL: https://issues.apache.org/jira/browse/NIFI-924 > Project: Apache NiFi > Issue Type: New Feature > Reporter: Jean-Baptiste Onofr=C3=A9 > > I'm working on a NiFi Route able to leverage a Camel route (runtime routi= ng), and another one being able to bootstrap a Camel route starting from Ca= mel DSLs. -- This message was sent by Atlassian JIRA (v6.3.4#6332)