src/share/classes/java/nio/file/Files.java

Print this page

        

*** 1710,1723 **** * options indicating how symbolic links are handled * * @return the {@code path} parameter * * @throws UnsupportedOperationException ! * if the attribute view is not available or it does not support ! * updating the attribute * @throws IllegalArgumentException ! * if the attribute value is of the correct type but has an * inappropriate value * @throws ClassCastException * if the attribute value is not of the expected type or is a * collection containing elements that are not of the expected * type --- 1710,1723 ---- * options indicating how symbolic links are handled * * @return the {@code path} parameter * * @throws UnsupportedOperationException ! * if the attribute view is not available * @throws IllegalArgumentException ! * if the attribute name is not specified, or is not recognized, or ! * the attribute value is of the correct type but has an * inappropriate value * @throws ClassCastException * if the attribute value is not of the expected type or is a * collection containing elements that are not of the expected * type
*** 1774,1786 **** * @param attribute * the attribute to read * @param options * options indicating how symbolic links are handled * ! * @return the attribute value or {@code null} if the attribute view ! * is not available or it does not support reading the attribute * * @throws IOException * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is * installed, its {@link SecurityManager#checkRead(String) checkRead} --- 1774,1789 ---- * @param attribute * the attribute to read * @param options * options indicating how symbolic links are handled * ! * @return the attribute value * + * @throws UnsupportedOperationException + * if the attribute view is not available + * @throws IllegalArgumentException + * if the attribute name is not specified or is not recognized * @throws IOException * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is * installed, its {@link SecurityManager#checkRead(String) checkRead}
*** 1792,1803 **** LinkOption... options) throws IOException { // only one attribute should be read if (attribute.indexOf('*') >= 0 || attribute.indexOf(',') >= 0) ! return null; Map<String,Object> map = readAttributes(path, attribute, options); String name; int pos = attribute.indexOf(':'); if (pos == -1) { name = attribute; } else { --- 1795,1807 ---- LinkOption... options) throws IOException { // only one attribute should be read if (attribute.indexOf('*') >= 0 || attribute.indexOf(',') >= 0) ! throw new IllegalArgumentException(attribute); Map<String,Object> map = readAttributes(path, attribute, options); + assert map.size() == 1; String name; int pos = attribute.indexOf(':'); if (pos == -1) { name = attribute; } else {
*** 1866,1878 **** * @param attributes * the attributes to read * @param options * options indicating how symbolic links are handled * ! * @return a map of the attributes returned; may be empty. The map's keys ! * are the attribute names, its values are the attribute values * * @throws IOException * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is * installed, its {@link SecurityManager#checkRead(String) checkRead} --- 1870,1887 ---- * @param attributes * the attributes to read * @param options * options indicating how symbolic links are handled * ! * @return a map of the attributes returned; The map's keys are the ! * attribute names, its values are the attribute values * + * @throws UnsupportedOperationException + * if the attribute view is not available + * @throws IllegalArgumentException + * if no attributes are specified or an unrecognized attributes is + * specified * @throws IOException * if an I/O error occurs * @throws SecurityException * In the case of the default provider, and a security manager is * installed, its {@link SecurityManager#checkRead(String) checkRead}