Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 7085 invoked from network); 23 Aug 2002 04:32:29 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 23 Aug 2002 04:32:29 -0000 Received: (qmail 3074 invoked by uid 97); 23 Aug 2002 04:33:05 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 3028 invoked by uid 97); 23 Aug 2002 04:33:04 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 3016 invoked by uid 98); 23 Aug 2002 04:33:04 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "Andrew Conrad" To: "'Jakarta Commons Developers List'" Subject: RE: [lang] System properties Date: Fri, 23 Aug 2002 00:31:07 -0400 Message-ID: <001201c24a5d$e665cb40$6500a8c0@computer2> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <012c01c24a16$59449d00$017627d9@oemcomputer> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I just joined the Commons-Dev, so don't shoot me for my comments but here goes: I was looking at your SystemUtils class, and I was thinking that using it would be a little clumsy. Instead of using boolean types for IS_WINDOWS and IS_UNIX, do you think it would be more friendly if you used int types such as OS_TYPE_WINDOWS, OS_TYPE_UNIX and a static method getOSType() . I was thinking of an execution that might want to branch, you could use a switch instead of a lot of if/else's switch( SystemUtils.getOSType() ) { case SystemUtils.OS_TYPE_WINDOWS: break; case SystemUtils.OS_TYPE_WINDOWS: break; } I guess it's probably just a preference of coding style.... Also, a different naming convention could be OS_FAMILIY_ and getOSFamily() Just thinking out loud. If you guys like this idea, I'm offering to rewrite the class. - Andrew > -----Original Message----- > From: Stephen Colebourne [mailto:scolebourne@btopenworld.com] > Sent: Thursday, August 22, 2002 3:59 PM > To: Jakarta Commons Developers List > Subject: [lang] System properties > > > One part I find inconvenient about Java is the system > properties. These are looked up by a string name, and I can > never remember what the name is, so I have to go and look it > up the javadoc - a great waste of time. > > The following code, is the solution in my library. Although > seemingly trivial, it means that any IDE can use code > completion to pick the value without needing to remember the > string name. > > public static final String LINE_SEPARATOR = > System.getProperty("line.separator"); > public static final String PATH_SEPARATOR = > System.getProperty("path.separator"); > public static final String FILE_SEPARATOR = > System.getProperty("file.separator"); > public static final String WORKING_DIRECTORY = > System.getProperty("user.dir"); > public static final String OS_NAME = > System.getProperty("os.name"); > public static final String OS_ARCH = > System.getProperty("os.arch"); > public static final String OS_VERSION = > System.getProperty("os.version"); > public static final String JAVA_VERSION = > System.getProperty("java.version"); > > How about a SystemUtils for [lang] ? > > Stephen > > > -- > To unsubscribe, e-mail: > unsubscribe@jakarta.apache.org> > For > additional commands, > e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: