/** * @throws IllegalArgumentException * @throws UnsupportedOperationException * @throws NoSuchFileException * @throws IOException * @throws SecurityException * @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#newInputStream(java.nio.file.Path, java.nio.file.OpenOption...)">Original JavaDoc</a> */ public static InputStream newInputStream( final Path path, final OpenOption... options ) throws IllegalArgumentException, NoSuchFileException, UnsupportedOperationException, IOException, SecurityException { checkNotNull( "path", path ); return providerOf( path ).newInputStream( path, options ); }
@Override public File toFile() throws UnsupportedOperationException { if ( file == null ) { synchronized ( this ) { if ( isRegularFile() ) { try { file = File.createTempFile( "git", "temp" ); final InputStream in = getFileSystem().provider().newInputStream( this ); final OutputStream out = new FileOutputStream( file ); internalCopy( in, out ); in.close(); out.close(); } catch ( final Exception ex ) { file = null; } } else { throw new UnsupportedOperationException(); } } } return file; }