Mercurial > hg > human-echolocation-java-webapp
comparison src/HumanEchoServlet.java @ 62:21bab43ae2c1
Use File.separator
author | Chris Cannam |
---|---|
date | Tue, 30 Sep 2014 12:28:01 +0100 |
parents | b3f3b42b9933 |
children | b8f8ed1ef8dd |
comparison
equal
deleted
inserted
replaced
61:c3d749d029ee | 62:21bab43ae2c1 |
---|---|
129 sb.append("_w"); | 129 sb.append("_w"); |
130 sb.append(dirweight); | 130 sb.append(dirweight); |
131 | 131 |
132 outputfname = sb.toString(); | 132 outputfname = sb.toString(); |
133 | 133 |
134 String target = outdir + "/" + outputfname + ".wav"; | 134 String target = outdir + File.separator + outputfname + ".wav"; |
135 File targetFile = new File(target); | 135 File targetFile = new File(target); |
136 targetFile.deleteOnExit(); | 136 targetFile.deleteOnExit(); |
137 | 137 |
138 if (!targetFile.exists()) { | 138 if (!targetFile.exists()) { |
139 | 139 |
140 try { | 140 try { |
141 logger.info("Property catalina.base is " + System.getProperty("catalina.base")); | 141 logger.info("Property catalina.base is " + System.getProperty("catalina.base")); |
142 | 142 |
143 String tempDir = outdir + "/" + getDirToken(); | 143 String tempDir = outdir + File.separator + getDirToken(); |
144 File tempDirFilePath = new File(tempDir); | 144 File tempDirFilePath = new File(tempDir); |
145 tempDirFilePath.mkdirs(); | 145 tempDirFilePath.mkdirs(); |
146 | 146 |
147 // Matlab structure: | 147 // Matlab structure: |
148 // | 148 // |
165 | 165 |
166 Input.set("outname", 1, outputfname); | 166 Input.set("outname", 1, outputfname); |
167 | 167 |
168 Object[] result = echo.simulateBinauralSignals(Input); | 168 Object[] result = echo.simulateBinauralSignals(Input); |
169 | 169 |
170 File createdFile = new File(tempDir + "/" + outputfname + ".wav"); | 170 File createdFile = new File(tempDir + File.separator + outputfname + ".wav"); |
171 if (!createdFile.exists()) { | 171 if (!createdFile.exists()) { |
172 String err = "The simulateBinauralSignals call failed to create expected output file \"" + createdFile + "\""; | 172 String err = "The simulateBinauralSignals call failed to create expected output file \"" + createdFile + "\""; |
173 logger.error(err); | 173 logger.error(err); |
174 throw new ServletException(err); | 174 throw new ServletException(err); |
175 } | 175 } |