01: /*
02: * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: /*
27: * @(#)WinNTFileSystem.java 1.19 07/05/05
28: */
29:
30: package java.io;
31:
32: /**
33: * Unicode-aware FileSystem for Windows NT/2000.
34: *
35: * @author Konstantin Kladko
36: * @version 1.19, 07/05/05
37: * @since 1.4
38: */
39: class WinNTFileSystem extends Win32FileSystem {
40:
41: protected native String canonicalize0(String path)
42: throws IOException;
43:
44: protected native String canonicalizeWithPrefix0(
45: String canonicalPrefix, String pathWithCanonicalPrefix)
46: throws IOException;
47:
48: /* -- Attribute accessors -- */
49:
50: public native int getBooleanAttributes(File f);
51:
52: public native boolean checkAccess(File f, int access);
53:
54: public native long getLastModifiedTime(File f);
55:
56: public native long getLength(File f);
57:
58: public native boolean setPermission(File f, int access,
59: boolean enable, boolean owneronly);
60:
61: public long getSpace(File f, int t) {
62: if (f.exists()) {
63: return getSpace0(f, t);
64: }
65: return 0;
66: }
67:
68: private native long getSpace0(File f, int t);
69:
70: /* -- File operations -- */
71:
72: public native boolean createFileExclusively(String path)
73: throws IOException;
74:
75: protected native boolean delete0(File f);
76:
77: public native String[] list(File f);
78:
79: public native boolean createDirectory(File f);
80:
81: protected native boolean rename0(File f1, File f2);
82:
83: public native boolean setLastModifiedTime(File f, long time);
84:
85: public native boolean setReadOnly(File f);
86:
87: protected native String getDriveDirectory(int drive);
88:
89: private static native void initIDs();
90:
91: static {
92: initIDs();
93: }
94: }
|