Package org.uberfire.java.nio

Examples of org.uberfire.java.nio.IOException


        simple.postVisitDirectory( dir, null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void postVisitDirectoryNull2() {
        simple.postVisitDirectory( null, new IOException() );
    }
View Full Code Here


        simple.visitFileFailed( file, null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void visitFileFailedNull2() {
        simple.visitFileFailed( null, new IOException() );
    }
View Full Code Here

            @Override
            public FileVisitResult preVisitDirectory( Path dir,
                                                      BasicFileAttributes attrs ) throws IOException {
                preDir.addAndGet( 1 );
                if ( preDir.get() > 1 ) {
                    throw new IOException();
                }
                return FileVisitResult.CONTINUE;
            }

            @Override
View Full Code Here

            while ( ( n = in.read( buf ) ) > 0 ) {
                out.write( buf, 0, n );
                read += n;
            }
        } catch ( java.io.IOException e ) {
            throw new IOException( e );
        }
        return read;
    }
View Full Code Here

            daemonService = new Daemon( new InetSocketAddress( DAEMON_HOST_ADDR, DAEMON_PORT ) );
            daemonService.setRepositoryResolver( new RepositoryResolverImpl<DaemonClient>() );
            try {
                daemonService.start();
            } catch ( java.io.IOException e ) {
                throw new IOException( e );
            }
        }
    }
View Full Code Here

                final Map<String, String> params = getQueryParams( uri );
                syncRepository( fileSystem.gitRepo(), fileSystem.getCredential(), params.get( "sync" ), hasForceFlag( uri ) );
                final ObjectId newHead = JGitUtil.getTreeRefObjectId( fileSystem.gitRepo().getRepository(), treeRef );
                notifyDiffs( fileSystem, treeRef, "<system>", "<system>", "", oldHead, newHead );
            } catch ( final Exception ex ) {
                throw new IOException( ex );
            }
        }
        if ( hasPushFlag( uri ) ) {
            try {
                final Map<String, String> params = getQueryParams( uri );
                pushRepository( fileSystem.gitRepo(), fileSystem.getCredential(), params.get( "push" ), hasForceFlag( uri ) );
            } catch ( final Exception ex ) {
                throw new IOException( ex );
            }
        }

        return fileSystem;
    }
View Full Code Here

        final JGitPathImpl gPath = toPathImpl( path );

        final Pair<PathType, ObjectId> result = checkPath( gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath() );

        if ( result.getK1().equals( PathType.DIRECTORY ) ) {
            throw new IOException();
        }

        try {
            final File file = File.createTempFile( "gitz", "woot" );
            return new FilterOutputStream( new FileOutputStream( file ) ) {
                public void close() throws java.io.IOException {
                    super.close();

                    commit( gPath, buildCommitInfo( null, Arrays.asList( options ) ), new DefaultCommitContent( new HashMap<String, File>() {{
                        put( gPath.getPath(), file );
                    }} ) );
                }
            };
        } catch ( java.io.IOException e ) {
            throw new IOException( e );
        }
    }
View Full Code Here

        }

        final Pair<PathType, ObjectId> result = checkPath( gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath() );

        if ( result.getK1().equals( PathType.DIRECTORY ) ) {
            throw new IOException();
        }

        try {
            if ( options != null && options.contains( READ ) ) {
                return openAByteChannel( path );
            } else {
                return createANewByteChannel( path, options, gPath, attrs );
            }
        } catch ( java.io.IOException e ) {
            throw new IOException( e );
        } finally {
            ( (AbstractPath) path ).clearCache();
        }
    }
View Full Code Here

            boolean isClosed = false;

            @Override
            public void close() throws IOException {
                if ( isClosed ) {
                    throw new IOException();
                }
                isClosed = true;
            }

            @Override
            public Iterator<Path> iterator() {
                if ( isClosed ) {
                    throw new IOException();
                }
                return new Iterator<Path>() {
                    private int i = -1;
                    private Path nextEntry = null;
                    public boolean atEof = false;
View Full Code Here

        try {
            final OutputStream outputStream = newOutputStream( path.resolve( ".gitignore" ) );
            outputStream.write( "# empty\n".getBytes() );
            outputStream.close();
        } catch ( final Exception e ) {
            throw new IOException( e );
        }
    }
View Full Code Here

TOP

Related Classes of org.uberfire.java.nio.IOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.