01: /*
02: * Path.java
03: *
04: * Copyright (C) 1998-2002 Peter Graves
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: */
20:
21: package org.armedbear.j;
22:
23: import java.util.StringTokenizer;
24:
25: public final class Path {
26: private String[] array;
27:
28: public Path(String s) {
29: StringTokenizer st = new StringTokenizer(s, LocalFile
30: .getPathSeparator());
31: int count = st.countTokens();
32: if (count > 0) {
33: array = new String[count];
34: for (int i = 0; i < count; i++)
35: array[i] = st.nextToken();
36: }
37: }
38:
39: // Might return null.
40: public String[] list() {
41: return array;
42: }
43: }
|