1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 only, as
8  * published by the Free Software Foundation.  Oracle designates this
9  * particular file as subject to the "Classpath" exception as provided
10  * by Oracle in the LICENSE file that accompanied this code.
11  *
12  * This code is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * version 2 for more details (a copy is included in the LICENSE file that
16  * accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License version
19  * 2 along with this work; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23  * or visit www.oracle.com if you need additional information or have any
24  * questions.
25  */
26 
27 package java.io;
28 
29 import android.compat.annotation.UnsupportedAppUsage;
30 
31 @SuppressWarnings({"unchecked", "deprecation", "all"})
32 abstract class FileSystem {
33 
FileSystem()34     FileSystem() {
35         throw new RuntimeException("Stub!");
36     }
37 
38     @UnsupportedAppUsage
getSeparator()39     public abstract char getSeparator();
40 
41     @UnsupportedAppUsage
getPathSeparator()42     public abstract char getPathSeparator();
43 
44     @UnsupportedAppUsage
normalize(java.lang.String path)45     public abstract java.lang.String normalize(java.lang.String path);
46 
47     @UnsupportedAppUsage
prefixLength(java.lang.String path)48     public abstract int prefixLength(java.lang.String path);
49 
50     @UnsupportedAppUsage
resolve(java.lang.String parent, java.lang.String child)51     public abstract java.lang.String resolve(java.lang.String parent, java.lang.String child);
52 
53     @UnsupportedAppUsage
getDefaultParent()54     public abstract java.lang.String getDefaultParent();
55 
56     @UnsupportedAppUsage
fromURIPath(java.lang.String path)57     public abstract java.lang.String fromURIPath(java.lang.String path);
58 
59     @UnsupportedAppUsage
isAbsolute(java.io.File f)60     public abstract boolean isAbsolute(java.io.File f);
61 
62     @UnsupportedAppUsage
resolve(java.io.File f)63     public abstract java.lang.String resolve(java.io.File f);
64 
65     @UnsupportedAppUsage
canonicalize(java.lang.String path)66     public abstract java.lang.String canonicalize(java.lang.String path) throws java.io.IOException;
67 
68     @UnsupportedAppUsage
getBooleanAttributes(java.io.File f)69     public abstract int getBooleanAttributes(java.io.File f);
70 
71     @UnsupportedAppUsage
checkAccess(java.io.File f, int access)72     public abstract boolean checkAccess(java.io.File f, int access);
73 
74     @UnsupportedAppUsage
setPermission( java.io.File f, int access, boolean enable, boolean owneronly)75     public abstract boolean setPermission(
76             java.io.File f, int access, boolean enable, boolean owneronly);
77 
78     @UnsupportedAppUsage
getLastModifiedTime(java.io.File f)79     public abstract long getLastModifiedTime(java.io.File f);
80 
81     @UnsupportedAppUsage
getLength(java.io.File f)82     public abstract long getLength(java.io.File f);
83 
84     @UnsupportedAppUsage
createFileExclusively(java.lang.String pathname)85     public abstract boolean createFileExclusively(java.lang.String pathname)
86             throws java.io.IOException;
87 
88     @UnsupportedAppUsage
delete(java.io.File f)89     public abstract boolean delete(java.io.File f);
90 
91     @UnsupportedAppUsage
list(java.io.File f)92     public abstract java.lang.String[] list(java.io.File f);
93 
94     @UnsupportedAppUsage
createDirectory(java.io.File f)95     public abstract boolean createDirectory(java.io.File f);
96 
97     @UnsupportedAppUsage
rename(java.io.File f1, java.io.File f2)98     public abstract boolean rename(java.io.File f1, java.io.File f2);
99 
100     @UnsupportedAppUsage
setLastModifiedTime(java.io.File f, long time)101     public abstract boolean setLastModifiedTime(java.io.File f, long time);
102 
103     @UnsupportedAppUsage
setReadOnly(java.io.File f)104     public abstract boolean setReadOnly(java.io.File f);
105 
106     @UnsupportedAppUsage
listRoots()107     public abstract java.io.File[] listRoots();
108 
109     @UnsupportedAppUsage
getSpace(java.io.File f, int t)110     public abstract long getSpace(java.io.File f, int t);
111 
112     @UnsupportedAppUsage
compare(java.io.File f1, java.io.File f2)113     public abstract int compare(java.io.File f1, java.io.File f2);
114 
115     @UnsupportedAppUsage
hashCode(java.io.File f)116     public abstract int hashCode(java.io.File f);
117 
getBooleanProperty(java.lang.String prop, boolean defaultVal)118     private static boolean getBooleanProperty(java.lang.String prop, boolean defaultVal) {
119         throw new RuntimeException("Stub!");
120     }
121 
122     public static final int ACCESS_EXECUTE = 1; // 0x1
123 
124     public static final int ACCESS_OK = 8; // 0x8
125 
126     public static final int ACCESS_READ = 4; // 0x4
127 
128     public static final int ACCESS_WRITE = 2; // 0x2
129 
130     public static final int BA_DIRECTORY = 4; // 0x4
131 
132     public static final int BA_EXISTS = 1; // 0x1
133 
134     public static final int BA_HIDDEN = 8; // 0x8
135 
136     public static final int BA_REGULAR = 2; // 0x2
137 
138     public static final int SPACE_FREE = 1; // 0x1
139 
140     public static final int SPACE_TOTAL = 0; // 0x0
141 
142     public static final int SPACE_USABLE = 2; // 0x2
143 
144     static boolean useCanonCaches = false;
145 
146     static boolean useCanonPrefixCache = false;
147 }
148