01: //
02: // Copyright (C) 2005 United States Government as represented by the
03: // Administrator of the National Aeronautics and Space Administration
04: // (NASA). All Rights Reserved.
05: //
06: // This software is distributed under the NASA Open Source Agreement
07: // (NOSA), version 1.3. The NOSA has been approved by the Open Source
08: // Initiative. See the file NOSA-1.3-JPF at the top of the distribution
09: // directory tree for the complete NOSA document.
10: //
11: // THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
12: // KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
13: // LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
14: // SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
15: // A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
16: // THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
17: // DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
18: //
19:
20: package java.io;
21:
22: /**
23: * MJI model class for java.io.File
24: *
25: * NOTE - a number of methods are only stubbed out here to make Eclipse compile
26: * JPF code that uses java.io.File (there is no way to tell Eclipse to exclude the
27: * model classes from ths build-path)
28: *
29: * @author Owen O'Malley
30: */
31: public class File {
32: public static final String separator = System
33: .getProperty("file.separator");
34: public static final char separatorChar = separator.charAt(0);
35: public static final String pathSeparator = System
36: .getProperty("path.separator");
37: public static final char pathSeparatorChar = pathSeparator
38: .charAt(0);
39:
40: public File(String filename) {
41: this .filename = filename;
42: }
43:
44: public File(String parent, String child) {
45: // <2do> just a dummy for now, to enable JPF compilation
46: filename = child;
47: }
48:
49: public long length() {
50: // <2do> just a dummy for now, to enable JPF compilation
51: return 0;
52: }
53:
54: public boolean exists() {
55: return false;
56: }
57:
58: public boolean delete() {
59: // not yet
60: return true;
61: }
62:
63: public boolean createNewFile() {
64: // not yet
65: return true;
66: }
67:
68: public String getName() {
69: return filename;
70: }
71:
72: public String getAbsolutePath() {
73: // not yet implemented
74: return null;
75: }
76:
77: public boolean isAbsolute() {
78: // not yet implemented
79: return false;
80: }
81:
82: private String filename;
83: }
|