

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
13 messages in org.apache.jackrabbit.usersRE: Getting the size of binary node c...| From | Sent On | Attachments |
|---|---|---|
| Alexander Nesterov | Oct 1, 2007 11:11 am | |
| Hendrik Beck (camunda) | Oct 1, 2007 12:51 pm | |
| Paco Avila | Oct 2, 2007 2:40 am | |
| Hendrik Beck (camunda) | Oct 2, 2007 4:39 am | |
| Thomas Mueller | Oct 2, 2007 6:07 am | |
| Alexander Nesterov | Oct 2, 2007 6:27 am | |
| Hendrik Beck (camunda) | Oct 2, 2007 6:31 am | |
| Thomas Mueller | Oct 2, 2007 6:44 am | |
| Paco Avila | Oct 2, 2007 1:27 pm | |
| Stefan Guggisberg | Oct 3, 2007 5:01 am | |
| Paco Avila | Oct 4, 2007 4:44 am | |
| Stefan Guggisberg | Oct 4, 2007 5:13 am | |
| Paco Avila | Oct 4, 2007 6:50 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | RE: Getting the size of binary node content | Actions... |
|---|---|---|
| From: | Hendrik Beck (camunda) (hend...@camunda.com) | |
| Date: | Oct 2, 2007 4:39:38 am | |
| List: | org.apache.jackrabbit.users | |
Hi Paco,
In our application (OpenKM - Document Management System) we store file size in a node property. I think it is faster than getting the document content size every time.
I agree, especially for Document Management System like OpenKM. The reason behind using InputStream.available() for this one case was that the size of every jcr:data property of nt:resource nodes should be shown *generically*, i.e. without adding properties or further customizing of node types. In that case we didn't see anything else than a) getting the size every time or b) using InputStream.available(). And: in that case it didn't really matter if it works in 100% of the cases. It was more that it was good to have it, but it's also not a problem if it fails it some cases, e.g. concurrent access of the same Stream by different users (which might such a case where it fails).
BR Hendrik
-----Original Message----- From: Paco Avila [mailto:pav...@git.es] Sent: Tuesday, October 02, 2007 4:41 PM To: use...@jackrabbit.apache.org Subject: RE: Getting the size of binary node content
El mar, 02-10-2007 a las 02:51 +0700, Hendrik Beck (camunda) escribió:
Hi Alexander,
make some property like "size" and set it while writing the file content into the database, or are there any better solutions?
We are doing that and it works well for us. In our application this is being done "on the way" while reading the binary data and doing some other stuff. And yep, then you just add another property "size" and store that value in it, e.g. by extending the nt:file or nt:resource node types.
We have also done it once by using the java.io.InputStream.available() method, e.g.
int size = myNode.getProperty("streamProperty").getStream().available();
In our application (OpenKM - Document Management System) we store file size in a node property. I think it is faster than getting the document content size every time.
-- GIT CONSULTORS
www.git.es
Tel: +34 971 498 310 Fax: +34 971 496 189
C/ Francesc Rover, 2B. 07003 Palma de Mallorca Illes Balears (España)







