Package org.codehaus.plexus.components.io.resources

Examples of org.codehaus.plexus.components.io.resources.PlexusIoResource


        {
            prefix = null;
        }
        for ( final Iterator iter = getSrc().getResources(); iter.hasNext(); )
        {
            PlexusIoResource plexusIoResource = (PlexusIoResource) iter.next();

            PlexusIoResourceAttributes attrs = null;
            if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
            {
                attrs = ( (PlexusIoResourceWithAttributes) plexusIoResource ).getAttributes();
            }

            if ( plexusIoResource.isDirectory() )
            {
                attrs =
                    PlexusIoResourceAttributeUtils.mergeAttributes( overrideDirAttributes, attrs, defaultDirAttributes );
            }
            else
            {
                attrs =
                    PlexusIoResourceAttributeUtils.mergeAttributes( overrideFileAttributes, attrs,
                                                                    defaultFileAttributes );
            }

            if ( !fileSelector.isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( !isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( plexusIoResource.isDirectory() && !isIncludingEmptyDirectories() )
            {
                continue;
            }
            if ( prefix != null )
            {
                final String name = plexusIoResource.getName();

                if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
                {
                    plexusIoResource = new PlexusIoProxyResourceWithAttributes( plexusIoResource, attrs );
                }
View Full Code Here


        {
            prefix = null;
        }
        for ( Iterator iter = getSrc().getResources();  iter.hasNext())
        {
            PlexusIoResource plexusIoResource = (PlexusIoResource) iter.next();
           
            PlexusIoResourceAttributes attrs = null;
            if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
            {
                attrs = ((PlexusIoResourceWithAttributes)plexusIoResource).getAttributes();
            }

            if ( plexusIoResource.isDirectory() )
            {
                attrs = PlexusIoResourceAttributeUtils.mergeAttributes( overrideDirAttributes, attrs, defaultDirAttributes );
            }
            else
            {
                attrs = PlexusIoResourceAttributeUtils.mergeAttributes( overrideFileAttributes, attrs, defaultFileAttributes );
            }
           
            if ( !fileSelector.isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( !isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( plexusIoResource.isDirectory() && !isIncludingEmptyDirectories() )
            {
                continue;
            }
            if ( prefix != null )
            {
                String name = plexusIoResource.getName();
               
                if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
                {
                    plexusIoResource = new PlexusIoProxyResourceWithAttributes( (PlexusIoResourceWithAttributes) plexusIoResource );
                }
View Full Code Here

    /**
     * @deprecated Use {@link #getSource()}.
     */
    public File getSourceFile()
    {
        final PlexusIoResource res = getSource();
        if ( res instanceof PlexusIoFileResource )
        {
            return ( (PlexusIoFileResource) res ).getFile();
        }
        return null;
View Full Code Here

                    }
                    else
                    {
                        if ( ioResourceIter.hasNext() )
                        {
                            final PlexusIoResource resource = (PlexusIoResource) ioResourceIter.next();
                            nextEntry = asArchiveEntry( currentResourceCollection, resource );
                        }
                        else
                        {
                            ioResourceIter = null;
View Full Code Here

        if ( vPath.length() <= 0 )
        {
            return;
        }

        final PlexusIoResource in = entry.getResource();
        final File outFile = new File( vPath );

        final long inLastModified = in.getLastModified();
        final long outLastModified = outFile.lastModified();
        if ( ResourceUtils.isUptodate( inLastModified, outLastModified ) )
        {
            return;
        }

        outFile.setLastModified( inLastModified == PlexusIoResource.UNKNOWN_MODIFICATION_DATE ? System.currentTimeMillis()
                        : inLastModified );

        if ( !in.isDirectory() )
        {
            if ( !outFile.getParentFile().exists() )
            {
                // create the parent directory...
                if ( !outFile.getParentFile().mkdirs() )
                {
                    // Failure, unable to create specified directory for some unknown reason.
                    throw new ArchiverException( "Unable to create directory or parent directory of " + outFile );
                }
            }
            ResourceUtils.copyFile( in, outFile );

            if ( !isIgnorePermissions() )
            {
                ArchiveEntryUtils.chmod( outFile, entry.getMode(), getLogger(), isUseJvmChmod() );
            }
        }
        else
        { // file is a directory
            if ( outFile.exists() )
            {
                if ( !outFile.isDirectory() )
                {
                    // should we just delete the file and replace it with a directory?
                    // throw an exception, let the user delete the file manually.
                    throw new ArchiverException( "Expected directory and found file at copy destination of "
                                    + in.getName() + " to " + outFile );
                }
            }
            else if ( !outFile.mkdirs() )
            {
                // Failure, unable to create specified directory for some unknown reason.
View Full Code Here

                    }
                    else
                    {
                        if ( ioResourceIter.hasNext() )
                        {
                            final PlexusIoResource resource = (PlexusIoResource) ioResourceIter.next();
                            nextEntry = asArchiveEntry( currentResourceCollection, resource );
                        }
                        else
                        {
                            ioResourceIter = null;
View Full Code Here

                        }
                        else
                        {
                            if ( ioResourceIter.hasNext() )
                            {
                                final PlexusIoResource resource = (PlexusIoResource) ioResourceIter.next();
                                nextEntry = asArchiveEntry( currentResourceCollection, resource );
                            }
                            else
                            {
                                ioResourceIter = null;
View Full Code Here

                    }
                    else
                    {
                        if ( ioResourceIter.hasNext() )
                        {
                            final PlexusIoResource resource = (PlexusIoResource) ioResourceIter.next();
                            nextEntry = asArchiveEntry( currentResourceCollection, resource );
                        }
                        else
                        {
                            ioResourceIter = null;
View Full Code Here

        {
            prefix = null;
        }
        for ( final Iterator<PlexusIoResource> iter = getSrc().getResources(); iter.hasNext(); )
        {
            PlexusIoResource plexusIoResource = iter.next();

            PlexusIoResourceAttributes attrs = null;
            if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
            {
                attrs = ( (PlexusIoResourceWithAttributes) plexusIoResource ).getAttributes();
            }

            if ( plexusIoResource.isDirectory() )
            {
                attrs =
                    PlexusIoResourceAttributeUtils.mergeAttributes(
                        getOverrideDirAttributes(), attrs, getDefaultDirAttributes() );
            }
            else
            {
                attrs =
                    PlexusIoResourceAttributeUtils.mergeAttributes(
                        getOverrideFileAttributes(), attrs, getDefaultFileAttributes() );
            }

            if ( !fileSelector.isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( !isSelected( plexusIoResource ) )
            {
                continue;
            }
            if ( plexusIoResource.isDirectory() && !isIncludingEmptyDirectories() )
            {
                continue;
            }
            if ( prefix != null )
            {
                final String name = plexusIoResource.getName();

                if ( plexusIoResource instanceof PlexusIoResourceWithAttributes )
                {
                    plexusIoResource = new PlexusIoProxyResourceWithAttributes( plexusIoResource, attrs );
                }
View Full Code Here

                    }
                    else
                    {
                        if ( ioResourceIter.hasNext() )
                        {
                            PlexusIoResource resource = (PlexusIoResource) ioResourceIter.next();
                            nextEntry = asArchiveEntry( currentResourceCollection, resource );
                        }
                        else
                        {
                            ioResourceIter = null;
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.components.io.resources.PlexusIoResource

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.