Changeset 1217
- Timestamp:
- 12/06/11 16:05:52 (18 months ago)
- Location:
- raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb
- Files:
-
- 2 edited
-
engine/ChartProcessor.java (modified) (2 diffs)
-
model/RaptorJFreeChartModel.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/engine/ChartProcessor.java
r1051 r1217 90 90 baseGraphDirectory.mkdir(); 91 91 92 // then check for the existence of the users directory within the ba e92 // then check for the existence of the users directory within the base 93 93 root = saveDirectory.getFile().getCanonicalPath() + "/" + user; 94 94 File dir = new File(root); … … 103 103 } 104 104 105 private File getRelativePath(File dir) { 106 File relative = null; 105 private String getRelativePath(File dir) { 107 106 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; 109 111 } catch (IOException e) { 110 112 log.error("Could not get relative path for file {}, {}", dir, e.getMessage()); 111 }112 return relative;113 return ""; 114 } 113 115 } 114 116 -
raptor-web/trunk/src/main/java/uk/ac/cardiff/raptorweb/model/RaptorJFreeChartModel.java
r899 r1217 35 35 private static final long serialVersionUID = -3533889063143775041L; 36 36 37 staticLogger log = LoggerFactory.getLogger(RaptorJFreeChartModel.class);37 private final Logger log = LoggerFactory.getLogger(RaptorJFreeChartModel.class); 38 38 39 39 private File chartLocation; 40 private FilerelativeChartLocation;40 private String relativeChartLocation; 41 41 private JFreeChart chart; 42 42 … … 49 49 } 50 50 51 public void setRelativeChartLocation( FilerelativeChartLocation) {51 public void setRelativeChartLocation(String relativeChartLocation) { 52 52 this.relativeChartLocation = relativeChartLocation; 53 53 } 54 54 55 public FilegetRelativeChartLocation() {55 public String getRelativeChartLocation() { 56 56 return relativeChartLocation; 57 57 } 58 58 59 59 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; 66 61 } 67 62
Note: See TracChangeset
for help on using the changeset viewer.
