| |
|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
| File Size Calculation in Java Compute Node |
« View previous topic :: View next topic » |
| Author |
Message
|
| kash3338 |
Posted: Wed Jun 04, 2014 3:10 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
| mqjeff wrote: |
I mean, assuming for example that the file hasn't been moved over FTP using ASCII mode. |
Also, there is a difference between "Size" and "Size On Disk". If the Header has the "Size On Disk" value, the BLOB length would be different  |
|
| Back to top |
|
 |
| Tibor |
Posted: Wed Jun 04, 2014 3:41 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
| kash3338 wrote: |
Also, there is a difference between "Size" and "Size On Disk". If the Header has the "Size On Disk" value, the BLOB length would be different  |
Yeah, the good old BOM  |
|
| Back to top |
|
 |
| Vitor |
Posted: Wed Jun 04, 2014 4:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
@DP1234 - seeing why we're not feeling this check of yours?
I repeat, what failure scenario are you trying to catch? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| DP1234 |
Posted: Thu Jun 05, 2014 10:38 am Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
| Vitor wrote: |
@DP1234 - seeing why we're not feeling this check of yours?
I repeat, what failure scenario are you trying to catch? |
There is an requirement scenario..,where my text file is intially checked for the integrity..this is done under fulfillment of 2 conditions..
1)Size of the file
2)Number of records
header will be having size and number of records info.
Upon fetching file from the directory i will have to extract above 2 info from the header and cross check with the actual values to check whether the file has tampered or not (I know file can also be tampered beyond these 2 condition but still this is wat the requirement is)
And then redirect to 2 diffrent directory upon good and bad for further process.
i had done using compute node where converting input mesage in to BLOB and then finding length which is equvalent to the file size and thts working fine.
Wanted same to be implemented in JCN aswell thts wat i was trying to do
Is it possible to convert incoming file content into blob in java compute node and then get length of it..? If so help me out..,i didn't find an java code related to this in forum and google aswell..help me out thru the links
Thanks |
|
| Back to top |
|
 |
| Vitor |
Posted: Thu Jun 05, 2014 11:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
| DP1234 wrote: |
There is an requirement scenario..,where my text file is intially checked for the integrity..this is done under fulfillment of 2 conditions..
1)Size of the file
2)Number of records
|
- An XML document doesn't have a fixed size
- An XML document doesn't have record.
| DP1234 wrote: |
| (I know file can also be tampered beyond these 2 condition but still this is wat the requirement is) |
I repeat - what failure scenario is this requirement intended to catch? I can mostly understand why you'd check the "record count" if we assume that a repeating high level tag is considered a "record" but why size?
| DP1234 wrote: |
| i had done using compute node where converting input mesage in to BLOB and then finding length which is equvalent to the file size and thts working fine. |
Except for the scenarios we gave above when this check is not reliable.
| DP1234 wrote: |
| i didn't find an java code related to this in forum and google aswell. |
And that should give you some indication of how commonly this is done. If this was the sort of integrity check people routinely perform don't you think some code would have shown up? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
| Back to top |
|
 |
| fjb_saper |
Posted: Thu Jun 05, 2014 7:25 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20769 Location: LI,NY
|
If you want to make sure the file has not been tampered with, you need to have it signed by the sender. You can check the signature with the X509 cert of said sender.
Anything else is just window dressing and is unreliable.
Have fun  _________________ MQ & Broker admin |
|
| Back to top |
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|