1 /*
2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95
96 /**
97 * Returns the number of bytes available to this Java virtual machine on the
98 * file store.
99 *
100 * <p> The returned number of available bytes is a hint, but not a
101 * guarantee, that it is possible to use most or any of these bytes. The
102 * number of usable bytes is most likely to be accurate immediately
103 * after the space attributes are obtained. It is likely to be made inaccurate
104 * by any external I/O operations including those made on the system outside
105 * of this Java virtual machine.
106 *
107 * @return the number of bytes available
108 *
109 * @throws IOException
110 * if an I/O error occurs
111 */
112 public abstract long getUsableSpace() throws IOException;
113
114 /**
115 * Returns the number of unallocated bytes in the file store.
116 *
117 * <p> The returned number of unallocated bytes is a hint, but not a
118 * guarantee, that it is possible to use most or any of these bytes. The
119 * number of unallocated bytes is most likely to be accurate immediately
120 * after the space attributes are obtained. It is likely to be
121 * made inaccurate by any external I/O operations including those made on
122 * the system outside of this virtual machine.
123 *
124 * @return the number of unallocated bytes
125 *
126 * @throws IOException
127 * if an I/O error occurs
128 */
129 public abstract long getUnallocatedSpace() throws IOException;
130
131 /**
132 * Tells whether or not this file store supports the file attributes
133 * identified by the given file attribute view.
134 *
|
1 /*
2 * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95
96 /**
97 * Returns the number of bytes available to this Java virtual machine on the
98 * file store.
99 *
100 * <p> The returned number of available bytes is a hint, but not a
101 * guarantee, that it is possible to use most or any of these bytes. The
102 * number of usable bytes is most likely to be accurate immediately
103 * after the space attributes are obtained. It is likely to be made inaccurate
104 * by any external I/O operations including those made on the system outside
105 * of this Java virtual machine.
106 *
107 * @return the number of bytes available
108 *
109 * @throws IOException
110 * if an I/O error occurs
111 */
112 public abstract long getUsableSpace() throws IOException;
113
114 /**
115 * Returns the number of bytes per block in this file store.
116 *
117 * <p> File storage is typically organized into discrete sequences of bytes
118 * called <i>blocks</i>. A block is the smallest storage unit of a file store.
119 * Every read and write operation is performed on a multiple of blocks.
120 *
121 * @implSpec The implementation in this class throws an
122 * {@code UnsupportedOperationException}.
123 *
124 * @return the block size of this file store, in bytes
125 *
126 * @throws IOException
127 * if an I/O error occurs
128 *
129 * @throws UnsupportedOperationException
130 * if the operation is not supported
131 *
132 * @since 10
133 */
134 public long getBlockSize() throws IOException {
135 throw new UnsupportedOperationException();
136 }
137
138 /**
139 * Returns the number of unallocated bytes in the file store.
140 *
141 * <p> The returned number of unallocated bytes is a hint, but not a
142 * guarantee, that it is possible to use most or any of these bytes. The
143 * number of unallocated bytes is most likely to be accurate immediately
144 * after the space attributes are obtained. It is likely to be
145 * made inaccurate by any external I/O operations including those made on
146 * the system outside of this virtual machine.
147 *
148 * @return the number of unallocated bytes
149 *
150 * @throws IOException
151 * if an I/O error occurs
152 */
153 public abstract long getUnallocatedSpace() throws IOException;
154
155 /**
156 * Tells whether or not this file store supports the file attributes
157 * identified by the given file attribute view.
158 *
|