Building Controls Virtual Test Bed
GetPath.java
Go to the documentation of this file.
1 import java.util.Map;
2 
16 public class GetPath
17 {
22  public static void main(String[] args){
23  Map<String, String> envVar = System.getenv();
24  final String pat = envVar.get("Path");
25  if ( pat == null ){
26  System.err.println("Error in GetPath: Could not get environment variable.");
27  System.err.println("Note that this file is used for Windows only.");
28  System.exit(1);
29  }
30  final String[] ent = pat.split(";");
31  for(int i =0; i < ent.length; i++)
32  System.out.println(ent[i]);
33  }
34 }
35 
36 /*
37 ********************************************************************
38 Copyright Notice
39 ----------------
40 
41 Building Controls Virtual Test Bed (BCVTB) Copyright (c) 2008, The
42 Regents of the University of California, through Lawrence Berkeley
43 National Laboratory (subject to receipt of any required approvals from
44 the U.S. Dept. of Energy). All rights reserved.
45 
46 If you have questions about your rights to use or distribute this
47 software, please contact Berkeley Lab's Technology Transfer Department
48 at TTD@lbl.gov
49 
50 NOTICE. This software was developed under partial funding from the U.S.
51 Department of Energy. As such, the U.S. Government has been granted for
52 itself and others acting on its behalf a paid-up, nonexclusive,
53 irrevocable, worldwide license in the Software to reproduce, prepare
54 derivative works, and perform publicly and display publicly. Beginning
55 five (5) years after the date permission to assert copyright is obtained
56 from the U.S. Department of Energy, and subject to any subsequent five
57 (5) year renewals, the U.S. Government is granted for itself and others
58 acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide
59 license in the Software to reproduce, prepare derivative works,
60 distribute copies to the public, perform publicly and display publicly,
61 and to permit others to do so.
62 
63 
64 Modified BSD License agreement
65 ------------------------------
66 
67 Building Controls Virtual Test Bed (BCVTB) Copyright (c) 2008, The
68 Regents of the University of California, through Lawrence Berkeley
69 National Laboratory (subject to receipt of any required approvals from
70 the U.S. Dept. of Energy). All rights reserved.
71 
72 Redistribution and use in source and binary forms, with or without
73 modification, are permitted provided that the following conditions are met:
74 
75  1. Redistributions of source code must retain the above copyright
76  notice, this list of conditions and the following disclaimer.
77  2. Redistributions in binary form must reproduce the above copyright
78  notice, this list of conditions and the following disclaimer in
79  the documentation and/or other materials provided with the
80  distribution.
81  3. Neither the name of the University of California, Lawrence
82  Berkeley National Laboratory, U.S. Dept. of Energy nor the names
83  of its contributors may be used to endorse or promote products
84  derived from this software without specific prior written permission.
85 
86 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
87 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
88 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
89 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
90 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
91 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
92 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
93 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
94 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
95 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
96 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97 
98 You are under no obligation whatsoever to provide any bug fixes,
99 patches, or upgrades to the features, functionality or performance of
100 the source code ("Enhancements") to anyone; however, if you choose to
101 make your Enhancements available either publicly, or directly to
102 Lawrence Berkeley National Laboratory, without imposing a separate
103 written license agreement for such Enhancements, then you hereby grant
104 the following license: a non-exclusive, royalty-free perpetual license
105 to install, use, modify, prepare derivative works, incorporate into
106 other computer software, distribute, and sublicense such enhancements or
107 derivative works thereof, in binary and source code form.
108 
109 ********************************************************************
110 */
111 
Class to write the path variable on Windows with one argument on each line.
Definition: GetPath.java:16
for i
Definition: compile.m:69
static void main(String[] args)
Main method.
Definition: GetPath.java:22