[opencms-dev] How to read a file size

Ernesto De Santis ernesto.desantis at colaborativa.net
Thu Apr 1 18:57:00 CEST 2004


CmsResource::
getLength
public int getLength()Gets the length of the content (filesize).

    Returns:
    the length of the content.

bye, Ernesto.

----- Original Message ----- 
From: "Olli Aro" <olli_aro at yahoo.co.uk>
To: <opencms-dev at opencms.org>
Sent: Thursday, April 01, 2004 1:42 PM
Subject: [opencms-dev] How to read a file size


Hi all,



Does anyone know a system friendly way to get the file size information from
OpenCMS? I know I can get it with
cms.readFile(fileuri)).getContents().length, however this gets a little slow
with large files since it loads the whole file in memory…



Thanks,



Olli












---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.638 / Virus Database: 409 - Release Date: 21/03/2004




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.645 / Virus Database: 413 - Release Date: 28/03/2004




More information about the opencms-dev mailing list