Package org.uberfire.java.nio.file

Examples of org.uberfire.java.nio.file.NoSuchFileException


                                       final OpenOption... options )
            throws IllegalArgumentException, NoSuchFileException, IOException, SecurityException {
        checkNotNull( "path", path );
        final File file = path.toFile();
        if ( !file.exists() ) {
            throw new NoSuchFileException( file.toString() );
        }
        try {
            return new FileInputStream( path.toFile() );
        } catch ( FileNotFoundException e ) {
            throw new NoSuchFileException( e.getMessage() );
        }
    }
View Full Code Here


    public void delete( final Path path,
                        final DeleteOption... options ) throws NoSuchFileException, DirectoryNotEmptyException, IOException, SecurityException {
        checkNotNull( "path", path );

        if ( !path.toFile().exists() ) {
            throw new NoSuchFileException( path.toString() );
        }

        deleteIfExists( path, options );
    }
View Full Code Here

            throws UnsupportedOperationException, NoSuchFileException, AccessDeniedException, IOException, SecurityException {
        checkNotNull( "path", path );
        checkNotNull( "modes", modes );

        if ( !path.toFile().exists() ) {
            throw new NoSuchFileException( path.toString() );
        }

        if ( path.toFile() != null ) {
            for ( final AccessMode mode : modes ) {
                checkNotNull( "mode", mode );
View Full Code Here

        checkNotNull( "path", path );
        checkNotNull( "type", type );

        if ( !path.toFile().exists() ) {
            throw new NoSuchFileException( path.toString() );
        }

        final GeneralPathImpl gPath = toGeneralPathImpl( path );

        final V view = gPath.getAttrView( type );
View Full Code Here

            throws NoSuchFileException, UnsupportedOperationException, IOException, SecurityException {
        checkNotNull( "path", path );
        checkNotNull( "type", type );

        if ( !path.toFile().exists() ) {
            throw new NoSuchFileException( path.toString() );
        }

        if ( type == BasicFileAttributesImpl.class || type == BasicFileAttributes.class ) {
            final SimpleBasicFileAttributeView view = getFileAttributeView( path, SimpleBasicFileAttributeView.class, options );
            return (A) view.readAttributes();
View Full Code Here

                    continue;
                }
                return new ByteArrayInputStream( git.getRepository().open( tw.getObjectId( 0 ), Constants.OBJ_BLOB ).getBytes() );
            }
        } catch ( final Throwable t ) {
            throw new NoSuchFileException( "Can't find '" + gitPath + "' in tree '" + treeRef + "'" );
        } finally {
            if ( rw != null ) {
                rw.dispose();
            }
            if ( tw != null ) {
                tw.release();
            }
        }
        throw new NoSuchFileException( "" );
    }
View Full Code Here

                                                            final String branchName,
                                                            final String path ) {
        final JGitPathInfo pathInfo = resolvePath( fs.gitRepo(), branchName, path );

        if ( pathInfo == null ) {
            throw new NoSuchFileException( path );
        }

        final String gPath = fixPath( path );

        final ObjectId id = resolveObjectId( fs.gitRepo(), branchName );
View Full Code Here

                                                            final String branchName,
                                                            final String path ) {
        final JGitPathInfo pathInfo = resolvePath( fs.gitRepo(), branchName, path );

        if ( pathInfo == null ) {
            throw new NoSuchFileException( path );
        }

        final ObjectId id = resolveObjectId( fs.gitRepo(), branchName );
        final String gPath = fixPath( path );
View Full Code Here

            }
            throw new DirectoryNotEmptyException( path.toString() );
        }

        if ( result.getK1().equals( NOT_FOUND ) ) {
            throw new NoSuchFileException( path.toString() );
        }

        deleteResource( path, options );
    }
View Full Code Here

    public void deleteBranch( final JGitPathImpl path ) {
        final Ref branch = getBranch( path.getFileSystem().gitRepo(), path.getRefTree() );

        if ( branch == null ) {
            throw new NoSuchFileException( path.toString() );
        }

        JGitUtil.deleteBranch( path.getFileSystem().gitRepo(), branch );
    }
View Full Code Here

TOP

Related Classes of org.uberfire.java.nio.file.NoSuchFileException

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.