From dev-return-39201-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Sat Oct 1 16:42:36 2011 Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72D1A9FF6 for ; Sat, 1 Oct 2011 16:42:36 +0000 (UTC) Received: (qmail 46887 invoked by uid 500); 1 Oct 2011 16:42:36 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 46850 invoked by uid 500); 1 Oct 2011 16:42:36 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 46841 invoked by uid 99); 1 Oct 2011 16:42:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Oct 2011 16:42:36 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.179.121.31] (HELO fep11.mx.upcmail.net) (62.179.121.31) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Oct 2011 16:42:28 +0000 Received: from edge04.upcmail.net ([192.168.13.239]) by viefep11-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20111001164203.BHR1647.viefep11-int.chello.at@edge04.upcmail.net> for ; Sat, 1 Oct 2011 18:42:03 +0200 Received: from asgard.felixknecht.ch ([84.73.177.134]) by edge04.upcmail.net with edge id fUi01h00W2uMsfo04Ui2sp; Sat, 01 Oct 2011 18:42:03 +0200 X-SourceIP: 84.73.177.134 X-Authenticated-Sender: felixknecht@hispeed.ch Message-ID: <4E8742D8.7010207@apache.org> Date: Sat, 01 Oct 2011 18:42:00 +0200 From: Felix Knecht User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Uncheck file operations References: <4E872475.4010804@otego.com> <4E8740B4.5010508@gmail.com> In-Reply-To: <4E8740B4.5010508@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=HWkYZS0+VrF7DBwcY/1jDCl9/vw+sclK/cqazKbcp2w= c=1 sm=0 a=0Ba-A2mVnIQA:10 a=7qsJXG2k14gA:10 a=IkcTkHD0fZMA:10 a=FbxgEoSVaGnxXO6yRKgA:9 a=QEXdDO2ut3YA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On 10/01/2011 06:32 PM, Emmanuel Lecharny wrote: > On 10/1/11 4:32 PM, Felix Knecht wrote: >> Hi >> >> ApacheDs and probably also Shared has in many locations file >> operations like File.[delete|mkdir|...] where the return value >> (true|false) is unchecked. In Java-1.7 exists static methods for this >> in java.nio.file.Files [1] where an IOException is thrown if the >> operation fails, in < Java-1.7 a SecurityException is thrown only in >> some special cases and in all other cases the return value is 'false' >> and no Exception is thrown [2]. IMO we should check the return value >> of these operations and throw an IOException if the file/directory >> couldn't be created/delete/renamed ... >> If wanted I'll create a JIRA and go for it. > Go for it, but keep in mind we still have to support Java 6... I thought about some like which should be Java 6 compatible: if (!File.delete()) { throw new IOException("Could not delete file ..."); } > > Thanks ! > >