From user-return-27802-apmail-commons-user-archive=commons.apache.org@commons.apache.org Sat Sep 29 12:39:36 2012 Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 81CF9D5F5 for ; Sat, 29 Sep 2012 12:39:36 +0000 (UTC) Received: (qmail 98939 invoked by uid 500); 29 Sep 2012 12:39:35 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 98807 invoked by uid 500); 29 Sep 2012 12:39:35 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 98749 invoked by uid 99); 29 Sep 2012 12:39:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 12:39:34 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mgainty@hotmail.com designates 65.55.116.92 as permitted sender) Received: from [65.55.116.92] (HELO blu0-omc3-s17.blu0.hotmail.com) (65.55.116.92) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 12:39:26 +0000 Received: from BLU142-W11 ([65.55.116.74]) by blu0-omc3-s17.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 29 Sep 2012 05:39:05 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_ac863971-d2af-4243-995f-0a53e26e3f16_" X-Originating-IP: [74.104.173.229] From: Martin Gainty To: Subject: RE: [io] Are FileUtils and IOUtils thread safe? Date: Sat, 29 Sep 2012 08:39:05 -0400 Importance: Normal In-Reply-To: References: <33095823FD21DF429B481B5163264B799EFCE085C1@VMBX102.ihostexchange.net>, MIME-Version: 1.0 X-OriginalArrivalTime: 29 Sep 2012 12:39:05.0704 (UTC) FILETIME=[69B26680:01CD9E3F] X-Virus-Checked: Checked by ClamAV on apache.org --_ac863971-d2af-4243-995f-0a53e26e3f16_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Sebb public class FileUtils { /** * Instances should NOT be constructed in standard programming. */ public FileUtils() { super()=3B } /** * The number of bytes in a kilobyte. */ public static final long ONE_KB =3D 1024=3B /** * The number of bytes in a megabyte. */ public static final long ONE_MB =3D ONE_KB * ONE_KB=3B /** * The number of bytes in a 50 MB. */ private static final long FIFTY_MB =3D ONE_MB * 50=3B /** * The number of bytes in a gigabyte. */ public static final long ONE_GB =3D ONE_KB * ONE_MB=3B /** * An empty array of type File. */ public static final File[] EMPTY_FILE_ARRAY =3D new File[0]=3B /** * The UTF-8 character set=2C used to decode octets in URLs. */ private static final Charset UTF8 =3D Charset.forName("UTF-8")=3B //---------------------------------------------------------------------= -- /** * Returns the path to the system temporary directory. *=20 * @return the path to the system temporary directory. *=20 * @since Commons IO 2.0 */ public static String getTempDirectoryPath() { return System.getProperty("java.io.tmpdir")=3B } how is public static immutable? how is public static threadsafe? Martin Gainty=20 ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng= er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter= leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l= ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin= dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w= ir keine Haftung fuer den Inhalt uebernehmen. > Date: Sat=2C 29 Sep 2012 12:49:57 +0100 > Subject: Re: [io] Are FileUtils and IOUtils thread safe? > From: sebbaz@gmail.com > To: user@commons.apache.org >=20 > On 29 September 2012 04:20=2C Yungwei Chen wrote: > > Hi=2C > > > > I would like to know if FileUtils and IOUtils are thread safe. Thanks. >=20 > The classes themselves are immutable and so are thread safe. >=20 > However=2C many of them use JVM classes that may not be thread safe. >=20 > Also=2C methods that depend on the state of the file system may not be > immune to external influences. >=20 > --------------------------------------------------------------------- > To unsubscribe=2C e-mail: user-unsubscribe@commons.apache.org > For additional commands=2C e-mail: user-help@commons.apache.org >=20 = --_ac863971-d2af-4243-995f-0a53e26e3f16_--