Package org.apache.maven.wagon

Examples of org.apache.maven.wagon.ResourceDoesNotExistException


                break;
            }
        }
        catch ( MalformedURLException e )
        {
            throw new ResourceDoesNotExistException( "Invalid repository URL: " + e.getMessage(), e );
        }
        catch ( FileNotFoundException e )
        {
            throw new ResourceDoesNotExistException( "Unable to locate resource in repository", e );
        }
        catch ( IOException e )
        {
            StringBuilder message = new StringBuilder( "Error transferring file: " );
            message.append( e.getMessage() );
View Full Code Here


                case HttpURLConnection.HTTP_FORBIDDEN:
                    throw new AuthorizationException( "Access denied to: " + buildUrl( resource.getName() ) );

                case HttpURLConnection.HTTP_NOT_FOUND:
                    throw new ResourceDoesNotExistException(
                        "File: " + buildUrl( resource.getName() ) + " does not exist" );

                    // add more entries here
                default:
                    throw new TransferFailedException(
View Full Code Here

                case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
                    throw new AuthorizationException( "Not authorized by proxy." );

                case HttpStatus.SC_NOT_FOUND:
                    throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );

                    //add more entries here
                default:
                    throw new TransferFailedException(
                        "Failed to transfer file: " + url + ". Return code is: " + statusCode );
View Full Code Here

            Streams streams = executor.executeCommand( "ls -FlA \"" + path + "\"", false );

            List<String> ret = new LSParser().parseFiles( streams.getOut() );
            if ( ret == null || ret.isEmpty() )
            {
                throw new ResourceDoesNotExistException( "No such file or directory" );
            }
            return ret;
        }
        catch ( CommandExecutionException e )
        {
            if ( e.getMessage().trim().endsWith( "No such file or directory" ) )
            {
                throw new ResourceDoesNotExistException( e.getMessage().trim(), e );
            }
            else if ( e.getMessage().trim().endsWith( "Not a directory" ) )
            {
                throw new ResourceDoesNotExistException( e.getMessage().trim(), e );
            }
            else
            {
                throw new TransferFailedException( "Error performing file listing.", e );
            }
View Full Code Here

            if ( exitCode != 0 )
            {
                if ( !put && err.getOutput().trim().toLowerCase( Locale.ENGLISH ).indexOf( "no such file or directory" )
                    != -1 )
                {
                    throw new ResourceDoesNotExistException( err.getOutput() );
                }
                else
                {
                    TransferFailedException e =
                        new TransferFailedException( "Exit code: " + exitCode + " - " + err.getOutput() );
View Full Code Here

        firePutInitiated( resource, source );

        if ( !source.exists() )
        {
            throw new ResourceDoesNotExistException( "Specified source file does not exist: " + source );
        }

        String basedir = getRepository().getBasedir();

        String resourceName = StringUtils.replace( destination, "\\", "/" );
View Full Code Here

                case HttpStatus.SC_FORBIDDEN:
                    fireSessionConnectionRefused();
                    throw new AuthorizationException( "Access denied to: " + url );

                case HttpStatus.SC_NOT_FOUND:
                    throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );

                    //add more entries here
                default:
                {
                    TransferFailedException e = new TransferFailedException(
View Full Code Here

            case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
                fireSessionConnectionRefused();
                throw new AuthorizationException( "Not authorized by proxy." );

            case HttpStatus.SC_NOT_FOUND:
                throw new ResourceDoesNotExistException( "File: " + url + " does not exist" );

                // add more entries here
            default:
            {
                cleanupGetTransfer( resource );
View Full Code Here

        File file = new File( getRepository().getBasedir(), resource.getName() );

        if ( !file.exists() )
        {
            throw new ResourceDoesNotExistException( "File: " + file + " does not exist" );
        }

        try
        {
            InputStream in = new BufferedInputStream( new FileInputStream( file ) );
View Full Code Here

        File path = resolveDestinationPath( destinationDirectory );

        if ( !path.exists() )
        {
            throw new ResourceDoesNotExistException( "Directory does not exist: " + destinationDirectory );
        }

        if ( !path.isDirectory() )
        {
            throw new ResourceDoesNotExistException( "Path is not a directory: " + destinationDirectory );
        }

        File[] files = path.listFiles();

        List<String> list = new ArrayList<String>( files.length );
View Full Code Here

TOP

Related Classes of org.apache.maven.wagon.ResourceDoesNotExistException

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.