Package org.codehaus.plexus.resource.loader

Examples of org.codehaus.plexus.resource.loader.FileResourceCreationException


  public void testGetCustomRunnerTemplateNotFound() throws ResourceNotFoundException, MojoExecutionException, MojoFailureException, FileResourceCreationException {
    this.subject.customRunnerTemplate = CUSTOM_RUNNER_TEMPLATE;
    when(this.mavenProject.getFile()).thenReturn(this.projectFile);
    when(this.projectFile.getParentFile()).thenReturn(this.parentProjectFile);
    when(this.parentProjectFile.getAbsolutePath()).thenReturn(PARENT_PROJECT_PATH);
    when(this.locator.getResourceAsFile(CUSTOM_RUNNER_TEMPLATE)).thenThrow(new FileResourceCreationException(CUSTOM_RUNNER_TEMPLATE));
    this.subject.execute();
  }
View Full Code Here


        {
            is = resource.getInputStream();
            File dir = outputFile.getParentFile();
            if ( !dir.isDirectory() && !dir.mkdirs() )
            {
                throw new FileResourceCreationException( "Failed to create directory " + dir.getPath() );
            }
            os = new FileOutputStream( outputFile );
            IOUtil.copy( is, os );
            is.close();
            is = null;
            os.close();
            os = null;
        }
        catch ( IOException e )
        {
            throw new FileResourceCreationException( "Cannot create file-based resource:" + e.getMessage(), e );
        }
        finally
        {
            IOUtil.close( is );
            IOUtil.close( os );
View Full Code Here

            IOUtil.copy( reader, writer );
        }
        catch ( IOException e )
        {
            throw new FileResourceCreationException( "Cannot create file-based resource.", e );
        }

        return outputFile;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.resource.loader.FileResourceCreationException

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.