Package org.uberfire.java.nio.file

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


                                 final FileAttribute<?>... attrs )
            throws UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException {
        checkNotNull( "dir", dir );
        final Path realDir = dir.toAbsolutePath();
        if ( realDir.toFile().exists() ) {
            throw new FileAlreadyExistsException( dir.toString() );
        }
        realDir.toFile().mkdirs();
    }
View Full Code Here


        checkNotNull( "target", target );
        checkCondition( "link and target can't be same", !link.equals( target ) );
        checkCondition( "target must already exists", target.toFile().exists() );

        if ( link.toFile().exists() ) {
            throw new FileAlreadyExistsException( link.toString() );
        }

        throw new UnsupportedOperationException();
    }
View Full Code Here

        checkNotNull( "existing", existing );
        checkCondition( "existing must already exists", existing.toFile().exists() );
        checkCondition( "link and target can't be same", !link.equals( existing ) );

        if ( link.toFile().exists() ) {
            throw new FileAlreadyExistsException( link.toString() );
        }

        throw new UnsupportedOperationException();
    }
View Full Code Here

        checkNotNull( "source", source );
        checkNotNull( "target", target );
        checkCondition( "source must exist", source.toFile().exists() );

        if ( target.toFile().exists() ) {
            throw new FileAlreadyExistsException( target.toString() );
        }
        if ( source.toFile().isDirectory() && source.toFile().list().length > 0 ) {
            throw new DirectoryNotEmptyException( source.toString() );
        }
View Full Code Here

        checkNotNull( "source", source );
        checkNotNull( "target", target );
        checkCondition( "source must exist", source.toFile().exists() );

        if ( target.toFile().exists() ) {
            throw new FileAlreadyExistsException( target.toString() );
        }

        if ( source.toFile().isDirectory() && source.toFile().list().length > 0 ) {
            throw new DirectoryNotEmptyException( source.toString() );
        }
View Full Code Here

            throws IllegalArgumentException, UnsupportedOperationException, FileAlreadyExistsException, IOException, SecurityException {
        final JGitPathImpl gPath = toPathImpl( path );

        if ( exists( path ) ) {
            if ( !shouldCreateOrOpenAByteChannel( options ) ) {
                throw new FileAlreadyExistsException( path.toString() );
            }
        }

        final Pair<PathType, ObjectId> result = checkPath( gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath() );
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( NOT_FOUND ) ) {
            throw new FileAlreadyExistsException( path.toString() );
        }

        try {
            final OutputStream outputStream = newOutputStream( path.resolve( ".gitignore" ) );
            outputStream.write( "# empty\n".getBytes() );
View Full Code Here

    private void copyBranch( final JGitPathImpl source,
                             final JGitPathImpl target ) {
        checkCondition( "source and taget should have same setup", !hasSameFileSystem( source, target ) );
        if ( existsBranch( target ) ) {
            throw new FileAlreadyExistsException( target.toString() );
        }
        if ( !existsBranch( source ) ) {
            throw new NoSuchFileException( target.toString() );
        }
        createBranch( source, target );
View Full Code Here

        final Pair<PathType, ObjectId> sourceResult = checkPath( source.getFileSystem().gitRepo(), source.getRefTree(), source.getPath() );
        final Pair<PathType, ObjectId> targetResult = checkPath( target.getFileSystem().gitRepo(), target.getRefTree(), target.getPath() );

        if ( !isRoot( target ) && targetResult.getK1() != NOT_FOUND ) {
            if ( !contains( options, StandardCopyOption.REPLACE_EXISTING ) ) {
                throw new FileAlreadyExistsException( target.toString() );
            }
        }

        if ( sourceResult.getK1() == NOT_FOUND ) {
            throw new NoSuchFileException( target.toString() );
View Full Code Here

        final Pair<PathType, ObjectId> sourceResult = checkPath( source.getFileSystem().gitRepo(), source.getRefTree(), source.getPath() );
        final Pair<PathType, ObjectId> targetResult = checkPath( target.getFileSystem().gitRepo(), target.getRefTree(), target.getPath() );

        if ( !isRoot( target ) && targetResult.getK1() != NOT_FOUND ) {
            if ( !contains( options, StandardCopyOption.REPLACE_EXISTING ) ) {
                throw new FileAlreadyExistsException( target.toString() );
            }
        }

        if ( sourceResult.getK1() == NOT_FOUND ) {
            throw new NoSuchFileException( target.toString() );
View Full Code Here

TOP

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

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.