KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > planetamessenger > io > JClassPath


1 /*
2     =========================================================================
3     Package io - Implements the IO and Streams methods.
4
5     This module is developed and maintained by PlanetaMessenger.org.
6     Specs, New and updated versions can be found in
7     http://www.planetamessenger.org
8     If you want contact the Team please send a email to Project Manager
9     Leidson Campos Alves Ferreira at leidson@planetamessenger.org
10
11     Copyright (C) since 2001 by PlanetaMessenger.org
12     
13     This library is free software; you can redistribute it and/or
14     modify it under the terms of the GNU Lesser General Public
15     License as published by the Free Software Foundation; either
16     version 2.1 of the License, or (at your option) any later version.
17
18     This library is distributed in the hope that it will be useful,
19     but WITHOUT ANY WARRANTY; without even the implied warranty of
20     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21     Lesser General Public License for more details.
22
23     You should have received a copy of the GNU Lesser General Public
24     License along with this library; if not, write to the Free Software
25     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
27     =========================================================================
28 */

29 /**
30  *
31  * $Id: JClassPath.java,v 1.7 2007/01/28 17:39:20 popolony2k Exp $
32  * $Author: popolony2k $
33  * $Name: $
34  * $Revision: 1.7 $
35  * $State: Exp $
36  *
37  */

38
39 package org.planetamessenger.io;
40
41
42 public class JClassPath {
43   
44   static final String JavaDoc LIBRARY_PATH = "java.library.path";
45   static final String JavaDoc CLASS_PATH = "java.class.path";
46   static final String JavaDoc PATH_SEPARATOR = "path.separator";
47   static final String JavaDoc FILE_SEPARATOR = "file.separator";
48   static final String JavaDoc USER_HOME = "user.home";
49   static final String JavaDoc USER_DIR = "user.dir";
50     
51   String JavaDoc strClassPath;
52
53   
54
55   /**
56    * Constructs a JClassPath class.
57    */

58   public JClassPath() {
59     
60     strClassPath = getDefaultClassPath();
61   }
62
63   /**
64    * Gets the current library path of JVM.
65    */

66   static public final String JavaDoc getLibraryPath() {
67   
68     return System.getProperty( LIBRARY_PATH );
69   }
70   
71   /**
72    * Gets the specific OS path separator.
73    */

74   static public final String JavaDoc getPathSeparator() {
75     
76     return System.getProperty( PATH_SEPARATOR );
77   }
78
79   /**
80    * Gets the specific OS file separator.
81    */

82   static public final String JavaDoc getFileSeparator() {
83     
84     return System.getProperty( FILE_SEPARATOR );
85   }
86
87   /**
88    * Gets the user home directory.
89    */

90   static public final String JavaDoc getUserHomeDirectory() {
91     
92     return System.getProperty( USER_HOME );
93   }
94
95   /**
96    * Gets the specific OS path separator.
97    */

98   static public final String JavaDoc getDefaultClassPath() {
99     
100     return System.getProperty( CLASS_PATH );
101   }
102   
103   /**
104    * Gets the current directory.
105    */

106   static public final String JavaDoc getCurrentDirectory() {
107     
108     return System.getProperty( USER_DIR );
109   }
110 }
111
112 // JClassPath class
113
Popular Tags