Changeset 1217


Ignore:
Timestamp:
12/06/11 16:05:52 (9 years ago)
Author:
philsmart
Message:
 
Location:
raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/engine/ChartProcessor.java

    r1051 r1217  
    9090                baseGraphDirectory.mkdir(); 
    9191 
    92             // then check for the existence of the users directory within the bae 
     92            // then check for the existence of the users directory within the base 
    9393            root = saveDirectory.getFile().getCanonicalPath() + "/" + user; 
    9494            File dir = new File(root); 
     
    103103    } 
    104104 
    105     private File getRelativePath(File dir) { 
    106         File relative = null; 
     105    private String getRelativePath(File dir) { 
    107106        try { 
    108             relative = new File(dir.getAbsolutePath().replace(baseDirectory.getFile().getAbsolutePath(), "")); 
     107            String relative = dir.getAbsolutePath().replace(baseDirectory.getFile().getAbsolutePath(), ""); 
     108            log.debug("Absolute Path {}, base Path {}, Relative Path is {}",new Object[]{dir.getAbsoluteFile(),baseDirectory.getFile().getAbsolutePath(),relative}); 
     109            relative = relative.replaceAll("\\\\","/"); 
     110            return relative; 
    109111        } catch (IOException e) { 
    110112            log.error("Could not get relative path for file {}, {}", dir, e.getMessage()); 
    111         } 
    112         return relative; 
     113            return ""; 
     114        } 
    113115    } 
    114116 
  • raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/model/RaptorJFreeChartModel.java

    r899 r1217  
    3535    private static final long serialVersionUID = -3533889063143775041L; 
    3636 
    37     static Logger log = LoggerFactory.getLogger(RaptorJFreeChartModel.class); 
     37    private final Logger log = LoggerFactory.getLogger(RaptorJFreeChartModel.class); 
    3838 
    3939    private File chartLocation; 
    40     private File relativeChartLocation; 
     40    private String relativeChartLocation; 
    4141    private JFreeChart chart; 
    4242 
     
    4949    } 
    5050 
    51     public void setRelativeChartLocation(File relativeChartLocation) { 
     51    public void setRelativeChartLocation(String relativeChartLocation) { 
    5252        this.relativeChartLocation = relativeChartLocation; 
    5353    } 
    5454 
    55     public File getRelativeChartLocation() { 
     55    public String getRelativeChartLocation() { 
    5656        return relativeChartLocation; 
    5757    } 
    5858 
    5959    public String getRelativeChartLocationPath(){ 
    60         try { 
    61             return relativeChartLocation.getCanonicalPath(); 
    62         } catch (IOException e) { 
    63            log.error("Could not get relative chart location for {}",relativeChartLocation); 
    64         } 
    65         return ""; 
     60        return relativeChartLocation; 
    6661    } 
    6762 
Note: See TracChangeset for help on using the changeset viewer.