public boolean isRegularFile() throws IllegalAccessError, SecurityException { try { return getFileSystem().provider().readAttributes( this, BasicFileAttributes.class ).isRegularFile(); } catch ( IOException ioe ) { } return false; }
/** * @throws IllegalArgumentException * @throws UnsupportedOperationException * @throws IOException * @throws SecurityException * @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getFileAttributeView(java.nio.file.Path, java.lang.Class, java.nio.file.LinkOption...)">Original JavaDoc</a> */ public static <A extends BasicFileAttributes> A readAttributes( final Path path, final Class<A> type, final LinkOption... options ) throws IllegalArgumentException, NoSuchFileException, UnsupportedOperationException, IOException, SecurityException { checkNotNull( "path", path ); checkNotNull( "type", type ); return providerOf( path ).readAttributes( path, type, options ); }
/** * @throws UnsupportedOperationException * @throws IllegalArgumentException * @throws IOException * @throws SecurityException * @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#readAttributes(java.nio.file.Path, java.lang.String, java.nio.file.LinkOption...)">Original JavaDoc</a> */ public static Map<String, Object> readAttributes( final Path path, final String attributes, final LinkOption... options ) throws UnsupportedOperationException, NoSuchFileException, IllegalArgumentException, IOException, SecurityException { checkNotNull( "path", path ); checkNotEmpty( "attributes", attributes ); if ( notExists( path ) ) { throw new NoSuchFileException( path.toString() ); } return providerOf( path ).readAttributes( path, attributes, options ); }