1 /* 2 * Copyright (c) 2007, 2009, 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 23 * questions. 24 */ 25 26 package java.nio.file.attribute; 27 28 import java.io.IOException; 29 30 /** 31 * A file store attribute view that supports reading of space attributes. 32 * 33 * <p> Where dynamic access to file attributes is required, the attributes 34 * supported by this attribute view have the following names and types: 35 * <blockquote> 36 * <table border="1" cellpadding="8"> 37 * <tr> 38 * <th> Name </th> 39 * <th> Type </th> 40 * </tr> 41 * <tr> 42 * <td> "totalSpace" </td> 43 * <td> {@link Long} </td> 44 * </tr> 45 * <tr> 46 * <td> "usableSpace" </td> 47 * <td> {@link Long} </td> 48 * </tr> 49 * <tr> 50 * <td> "unallocatedSpace" </td> 51 * <td> {@link Long} </td> 52 * </tr> 53 * </table> 54 * </blockquote> 55 * <p> The {@link java.nio.file.FileStore#getAttribute getAttribute} method may 56 * be used to read any of these attributes. 57 * 58 * @since 1.7 59 */ 60 61 public interface FileStoreSpaceAttributeView 62 extends FileStoreAttributeView 63 { 64 /** 65 * Returns the name of the attribute view. Attribute views of this type 66 * have the name {@code "space"}. 67 */ 68 @Override 69 String name(); 70 71 /** 72 * Reads the disk space attributes as a bulk operation. 73 * 74 * <p> It is file system specific if all attributes are read as an 75 * atomic operation with respect to other file system operations. 76 * 77 * @return The disk space attributes 78 * 79 * @throws IOException 80 * If an I/O error occurs 81 */ 82 FileStoreSpaceAttributes readAttributes() throws IOException; 83 }