View Javadoc

1   /*
2    * $Id: MediaCopierPostGrapher.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.tools.visualizer.postgraphers;
12  
13  import org.mule.tools.visualizer.components.PostGrapher;
14  import org.mule.tools.visualizer.config.GraphEnvironment;
15  import org.mule.util.FileUtils;
16  
17  import java.io.IOException;
18  
19  
20  public class MediaCopierPostGrapher implements PostGrapher
21  {
22  
23      public static final String MEDIA = "media";
24  
25      public String getStatusTitle()
26      {
27          return "Copy Media files (logo, css,...)";
28      }
29  
30      /**
31       * Extract media dir from mule-tools-visualizer.jar and copy it to output dir
32       *
33       * @param env enviropment and config variables
34       */
35      public void postGrapher(GraphEnvironment env)
36      {
37          try
38          {
39              FileUtils.extractResources(MEDIA, getClass(), env.getConfig().getOutputDirectory(), false);
40          }
41          catch (IOException e)
42          {
43              env.logError(e.getMessage(), e);
44          }
45      }
46  
47  }