Package org.apache.pluto.util

Examples of org.apache.pluto.util.UtilityException


        File dest = config.getDestination();
       
        try {       
           
            if ( source == null || !source.exists() ) {
                throw new UtilityException( "Source archive doesn't exist." );
            }
           
            if ( source.isDirectory() ) {
                throw new UtilityException( "Source archive is a directory." );
            }

            if ( performInPlaceAssembly( config ) ) {
                    if ( LOG.isDebugEnabled() ) {
                        LOG.debug( "Performing in-place assembly of " + config.getSource().getAbsolutePath() );
                    }
                    dest = File.createTempFile( source.getName(), ".tmp" );
                    config.setDestination( dest );
                    assembleInternal( config );
                    // renameTo() is impl-specific
                    boolean success = dest.renameTo( source );
                    if (! success ) {
                        // do it the old-fashioned way
                        FileUtils.copyFile( dest, source );
                    }
            } else {
                if ( LOG.isDebugEnabled() ) {
                    LOG.debug( "Performing assembly of " + config.getSource().getAbsolutePath() + " to " +
                            config.getDestination().getAbsolutePath() );
                }
                File destFile = dest;
               
                // if the destination is a directory, ensure that parent
                // directories have been created and set the destination
                // file to the file in the direcotory.
                if ( dest.isDirectory() ) {                               
                    dest.mkdirs();
                    destFile = new File( dest, source.getName() );
                }
               
                config.setDestination( destFile );
                assembleInternal( config );
            }
           
        } catch ( IOException e ) {
            LOG.error( "Assembly failed: "+ e.getMessage() );
            throw new UtilityException( e.getMessage(), e );
        }       
    }
View Full Code Here


//            out.write(getPortalApplicationConfig(config));
//            out.flush();
//            out.close();
        }
        catch (IOException io) {
            throw new UtilityException(io);
        }
    }
View Full Code Here

        File dest = config.getDestination();
       
        try {       
           
            if ( source == null || !source.exists() ) {
                throw new UtilityException( "Source archive doesn't exist." );
            }
           
            if ( source.isDirectory() ) {
                throw new UtilityException( "Source archive is a directory." );
            }

            if ( performInPlaceAssembly( config ) ) {
                    if ( LOG.isDebugEnabled() ) {
                        LOG.debug( "Performing in-place assembly of " + config.getSource().getAbsolutePath() );
                    }
                    dest = File.createTempFile( source.getName(), ".tmp" );
                    config.setDestination( dest );
                    assembleInternal( config );
                    // renameTo() is impl-specific
                    boolean success = dest.renameTo( source );
                    if (! success ) {
                        // do it the old-fashioned way
                        FileUtils.copyFile( dest, source );
                    }
            } else {
                if ( LOG.isDebugEnabled() ) {
                    LOG.debug( "Performing assembly of " + config.getSource().getAbsolutePath() + " to " +
                            config.getDestination().getAbsolutePath() );
                }
                File destFile = dest;
               
                // if the destination is a directory, ensure that parent
                // directories have been created and set the destination
                // file to the file in the direcotory.
                if ( dest.isDirectory() ) {                               
                    dest.mkdirs();
                    destFile = new File( dest, source.getName() );
                }
               
                config.setDestination( destFile );
                assembleInternal( config );
            }
           
        } catch ( IOException e ) {
            LOG.error( "Assembly failed: "+ e.getMessage() );
            throw new UtilityException( e.getMessage(), e );
        }       
    }
View Full Code Here

//            out.write(getPortalApplicationConfig(config));
//            out.flush();
//            out.close();
        }
        catch (IOException io) {
            throw new UtilityException(io);
        }
    }
View Full Code Here

            copyFileToDirectory(config.getPortalApplication(), domainDir);

            writeConfiguration(config);
        }
        catch(IOException io) {
            throw new UtilityException(
                "Unable to install portal to Tomcat",
                io,
                config.getInstallationDirectory()
            );
        }
View Full Code Here

            File delete = new File(domainDir, config.getPortalApplication().getName());
            delete.delete();
        }
        catch(IOException io) {
            throw new UtilityException("Unable to remove files. ", io, config.getInstallationDirectory());
        }

   }
View Full Code Here

                config.getPortletDescriptor());
            FileOutputStream webXmlOut = new FileOutputStream(
                config.getDestination());
            WebXmlStreamingAssembly.assembleStream(webXmlIn, portletXmlIn, webXmlOut, DISPATCH_SERVLET_CLASS);
        } catch (IOException ex) {
            throw new UtilityException(ex.getMessage(), ex, null);
        }
    }
View Full Code Here

                destinationDescriptor.getParentFile().mkdirs();
                final FileOutputStream webXmlOut = new FileOutputStream(destinationDescriptor);
                this.updateWebappDescriptor(webXmlIn, portletXmlIn, webXmlOut, config.getDispatchServletClass());
            }
        } catch (IOException ex) {
            throw new UtilityException(ex.getMessage(), ex, null);
        }
    }
View Full Code Here

            else {
                this.assembleWar(sourceArchive, destinationArchive, config.getDispatchServletClass());
            }
           
        } catch (IOException ex) {
            throw new UtilityException(ex.getMessage(), ex, null);
        }
    }
View Full Code Here

                destinationDescriptor.getParentFile().mkdirs();
                final FileOutputStream webXmlOut = new FileOutputStream(destinationDescriptor);
                this.updateWebappDescriptor(webXmlIn, portletXmlIn, webXmlOut, config.getDispatchServletClass());
            }
        } catch (IOException ex) {
            throw new UtilityException(ex.getMessage(), ex, null);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.util.UtilityException

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.