Package org.apache.maven.shared.io.location

Examples of org.apache.maven.shared.io.location.Location


            catch ( final Exception eee )
            {
                getLogger().error( "Error interpolating componentDescriptor: " + location, eee );
            }

            final Location resolvedLocation = locator.resolve( location );

            if ( resolvedLocation == null )
            {
                throw new AssemblyReadException( "Failed to locate component descriptor: " + location );
            }

            Component component = null;
            Reader reader = null;
            try
            {
                reader = new InputStreamReader( resolvedLocation.getInputStream() );
                component = new ComponentXpp3Reader().read( reader );
            }
            catch ( final IOException e )
            {
                throw new AssemblyReadException( "Error reading component descriptor: " + location + " (resolved to: "
                    + resolvedLocation.getSpecification() + ")", e );
            }
            catch ( final XmlPullParserException e )
            {
                throw new AssemblyReadException( "Error reading component descriptor: " + location + " (resolved to: "
                    + resolvedLocation.getSpecification() + ")", e );
            }
            finally
            {
                IOUtil.close( reader );
            }
View Full Code Here


    public void testResolvePrefixWithLeadingSlashAndWithTrailingSlash()
    {
        MessageHolder mh = new DefaultMessageHolder();

        LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "/assemblies/" );
        Location location = ls.resolve( "empty.xml", mh );

        assertNotNull( location );
        assertEquals( 0, mh.size() );
    }
View Full Code Here

    public void testResolvePrefixWithLeadingSlashAndWithoutTrailingSlash()
    {
        MessageHolder mh = new DefaultMessageHolder();

        LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "/assemblies" );
        Location location = ls.resolve( "empty.xml", mh );

        assertNotNull( location );
        assertEquals( 0, mh.size() );
    }
View Full Code Here

    public void testResolvePrefixWithoutLeadingSlashAndWithTrailingSlash()
    {
        MessageHolder mh = new DefaultMessageHolder();

        LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "assemblies/" );
        Location location = ls.resolve( "empty.xml", mh );

        assertNotNull( location );
        assertEquals( 0, mh.size() );
    }
View Full Code Here

    public void testResolvePrefixWithoutLeadingSlashAndWithoutTrailingSlash()
    {
        MessageHolder mh = new DefaultMessageHolder();

        LocatorStrategy ls = new PrefixedClasspathLocatorStrategy( "assemblies" );
        Location location = ls.resolve( "empty.xml", mh );

        assertNotNull( location );
        assertEquals( 0, mh.size() );
    }
View Full Code Here

    public Location resolve( String locationSpecification, MessageHolder messageHolder )
    {
        File file = new File( basedir, locationSpecification );
        messageHolder.addInfoMessage( "Searching for file location: " + file.getAbsolutePath() );

        Location location = null;

        if ( file.exists() )
        {
            location = new FileLocation( file, locationSpecification );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.shared.io.location.Location

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.